diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-02 18:03:41 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-02 18:03:41 +0100 |
commit | ac58ea8d88701a0b51972ac6666617bcfa61487b (patch) | |
tree | 21a0eaeda41dbb4b8f48a4d2ac72523267c1ebed /plugins | |
parent | 98e76473bd1abc342a8990f0a577ae08f9885307 (diff) |
improved column editing
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtkui/callbacks.c | 142 | ||||
-rw-r--r-- | plugins/gtkui/callbacks.h | 8 | ||||
-rw-r--r-- | plugins/gtkui/deadbeef.glade | 610 | ||||
-rw-r--r-- | plugins/gtkui/gtkplaylist.c | 29 | ||||
-rw-r--r-- | plugins/gtkui/gtkplaylist.h | 3 | ||||
-rw-r--r-- | plugins/gtkui/interface.c | 330 | ||||
-rw-r--r-- | plugins/gtkui/interface.h | 2 |
7 files changed, 574 insertions, 550 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 87026405..5672ccaf 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -44,7 +44,6 @@ #define VSELECT(it, sel) {deadbeef->pl_set_selected(it,sel);gtk_pl_redraw_item_everywhere (it);} #define PL_NEXT(it, iter) (deadbeef->pl_get_next(it, iter)) -GtkWidget *formatwin = NULL; gtkplaylist_t *last_playlist; extern GtkWidget *mainwin; extern gtkplaylist_t main_playlist; @@ -1748,82 +1747,74 @@ on_prefwin_delete_event (GtkWidget *widget, } void -pl_add_column (const char *title, int width, int id, const char *format, int align_right) -{ - gtkplaylist_t *ps = last_playlist; - - gtkpl_column_append (ps, gtkpl_column_alloc (title, width, id, format, align_right)); - - gtkpl_header_draw (ps); - gtkpl_expose_header (ps, 0, 0, ps->header->allocation.width, ps->header->allocation.height); - - gtkpl_draw_playlist (ps, 0, 0, ps->playlist->allocation.width, ps->playlist->allocation.height); - gtkpl_expose (ps, 0, 0, ps->playlist->allocation.width, ps->playlist->allocation.height); - - gtkpl_column_rewrite_config (ps); -} - -void -on_artist_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - GtkWidget *parent = GTK_WIDGET (menuitem); - do - { - parent = gtk_widget_get_parent (parent); - printf ("parent: %x\n", parent); - } while (parent); - pl_add_column ("Artist", 100, DB_COLUMN_ARTIST, NULL, 0); -} - - -void -on_album_activate (GtkMenuItem *menuitem, +on_add_column_activate (GtkMenuItem *menuitem, gpointer user_data) { - pl_add_column ("Album", 100, DB_COLUMN_ALBUM, NULL, 0); -} - - -void -on_tracknum_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - pl_add_column ("Track №", 50, DB_COLUMN_TRACK, NULL, 0); -} - - -void -on_duration_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - pl_add_column ("Duration", 50, DB_COLUMN_DURATION, NULL, 0); -} - + gtkplaylist_t *ps = last_playlist; + GtkWidget *dlg = create_editcolumndlg (); + gtk_combo_box_set_active (GTK_COMBO_BOX (lookup_widget (dlg, "id")), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (lookup_widget (dlg, "align")), 0); + gint response = gtk_dialog_run (GTK_DIALOG (dlg)); + if (response == GTK_RESPONSE_OK) { + const gchar *title = gtk_entry_get_text (GTK_ENTRY (lookup_widget (dlg, "title"))); + const gchar *format = gtk_entry_get_text (GTK_ENTRY (lookup_widget (dlg, "format"))); + int id = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "id"))) + 1; + int align = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "align"))); + if (id > DB_COLUMN_ID_MAX) { + id = -1; + } + gtkpl_column_insert_before (ps, ps->active_column, gtkpl_column_alloc (title, 100, id, format, align)); + gtkpl_header_draw (ps); + gtkpl_expose_header (ps, 0, 0, ps->header->allocation.width, ps->header->allocation.height); -void -on_playing_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - pl_add_column ("Playing", 50, DB_COLUMN_PLAYING, NULL, 0); + gtkpl_draw_playlist (ps, 0, 0, ps->playlist->allocation.width, ps->playlist->allocation.height); + gtkpl_expose (ps, 0, 0, ps->playlist->allocation.width, ps->playlist->allocation.height); + } + gtk_widget_destroy (dlg); } void -on_title_activate (GtkMenuItem *menuitem, +on_edit_column_activate (GtkMenuItem *menuitem, gpointer user_data) { - pl_add_column ("Title", 150, DB_COLUMN_TITLE, NULL, 0); -} + gtkplaylist_t *ps = last_playlist; + if (!ps->active_column) + return; + GtkWidget *dlg = create_editcolumndlg (); + gtk_entry_set_text (GTK_ENTRY (lookup_widget (dlg, "title")), ps->active_column->title); + gtk_entry_set_text (GTK_ENTRY (lookup_widget (dlg, "format")), ps->active_column->format); + if (ps->active_column->id == -1) { + gtk_combo_box_set_active (GTK_COMBO_BOX (lookup_widget (dlg, "id")), DB_COLUMN_ID_MAX); + } + else { + gtk_combo_box_set_active (GTK_COMBO_BOX (lookup_widget (dlg, "id")), ps->active_column->id-1); + } + gtk_combo_box_set_active (GTK_COMBO_BOX (lookup_widget (dlg, "align")), ps->active_column->align_right); + gint response = gtk_dialog_run (GTK_DIALOG (dlg)); + if (response == GTK_RESPONSE_OK) { + const gchar *title = gtk_entry_get_text (GTK_ENTRY (lookup_widget (dlg, "title"))); + const gchar *format = gtk_entry_get_text (GTK_ENTRY (lookup_widget (dlg, "format"))); + int id = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "id"))) + 1; + int align = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "align"))); + if (id > DB_COLUMN_ID_MAX) { + id = -1; + } + free (ps->active_column->title); + free (ps->active_column->format); + ps->active_column->title = strdup (title); + ps->active_column->format = strdup (format); + ps->active_column->id = id; + ps->active_column->align_right = align; + gtkpl_column_rewrite_config (ps); + gtkpl_header_draw (ps); + gtkpl_expose_header (ps, 0, 0, ps->header->allocation.width, ps->header->allocation.height); -void -on_custom_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - if (!formatwin) - formatwin = create_inputformat (); - gtk_widget_show (formatwin); + gtkpl_draw_playlist (ps, 0, 0, ps->playlist->allocation.width, ps->playlist->allocation.height); + gtkpl_expose (ps, 0, 0, ps->playlist->allocation.width, ps->playlist->allocation.height); + } + gtk_widget_destroy (dlg); } @@ -2382,24 +2373,6 @@ on_trackproperties_key_press_event (GtkWidget *widget, -void -on_format_cancel_clicked (GtkButton *button, - gpointer user_data) -{ - gtk_widget_hide (formatwin); -} - - -void -on_format_ok_clicked (GtkButton *button, - gpointer user_data) -{ - const gchar *title = gtk_entry_get_text (GTK_ENTRY (lookup_widget (formatwin, "titleentry"))); - const gchar *format = gtk_entry_get_text (GTK_ENTRY (lookup_widget (formatwin, "formatentry"))); - pl_add_column (title, 100, -1, format, 0); - gtk_widget_hide (formatwin); -} - void on_cursor_follows_playback_activate (GtkMenuItem *menuitem, @@ -2409,3 +2382,4 @@ on_cursor_follows_playback_activate (GtkMenuItem *menuitem, } + diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h index d6332190..7c5812a0 100644 --- a/plugins/gtkui/callbacks.h +++ b/plugins/gtkui/callbacks.h @@ -774,3 +774,11 @@ gboolean on_trackproperties_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data); + +void +on_add_column_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_edit_column_activate (GtkMenuItem *menuitem, + gpointer user_data); diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index 6122beb9..0a0ceda4 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -1385,6 +1385,7 @@ </widget> <widget class="GtkWindow" id="prefwin"> + <property name="border_width">3</property> <property name="width_request">642</property> <property name="height_request">372</property> <property name="visible">True</property> @@ -2429,87 +2430,23 @@ SOCKS5_HOSTNAME</property> <property name="visible">True</property> <property name="label" translatable="yes">Add column</property> <property name="use_underline">True</property> + <signal name="activate" handler="on_add_column_activate" last_modification_time="Sat, 02 Jan 2010 15:30:54 GMT"/> + </widget> + </child> - <child> - <widget class="GtkMenu" id="add_column_menu"> - - <child> - <widget class="GtkMenuItem" id="artist"> - <property name="visible">True</property> - <property name="label" translatable="yes">Artist</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_artist_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="album"> - <property name="visible">True</property> - <property name="label" translatable="yes">Album</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_album_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="tracknum"> - <property name="visible">True</property> - <property name="label" translatable="yes">Track number</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_tracknum_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="duration"> - <property name="visible">True</property> - <property name="label" translatable="yes">Duration</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_duration_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="playing"> - <property name="visible">True</property> - <property name="label" translatable="yes">Playing status</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_playing_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="title"> - <property name="visible">True</property> - <property name="label" translatable="yes">Title</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_title_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separator7"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="custom"> - <property name="visible">True</property> - <property name="label" translatable="yes">Custom</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_custom_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> - </widget> - </child> - </widget> - </child> + <child> + <widget class="GtkMenuItem" id="edit_column"> + <property name="visible">True</property> + <property name="label" translatable="yes">Edit column</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_edit_column_activate" last_modification_time="Sat, 02 Jan 2010 15:30:54 GMT"/> </widget> </child> <child> <widget class="GtkMenuItem" id="remove_column"> <property name="visible">True</property> - <property name="label" translatable="yes">Remove this column</property> + <property name="label" translatable="yes">Remove column</property> <property name="use_underline">True</property> <signal name="activate" handler="on_remove_column_activate" last_modification_time="Mon, 19 Oct 2009 19:30:04 GMT"/> </widget> @@ -2619,221 +2556,6 @@ SOCKS5_HOSTNAME</property> </child> </widget> -<widget class="GtkWindow" id="inputformat"> - <property name="visible">True</property> - <property name="title" translatable="yes">Column Format</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">True</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">True</property> - <property name="skip_pager_hint">True</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - - <child> - <widget class="GtkVBox" id="vbox8"> - <property name="border_width">4</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox10"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label26"> - <property name="visible">True</property> - <property name="label" translatable="yes">Title:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="titleentry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes">Enter new column title here</property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox9"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="format"> - <property name="visible">True</property> - <property name="label" translatable="yes">Format:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="formatentry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label25"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Format fields: - %a - artist - %t - title - %b - album - %n - track - %l - duration - %y - year - %g - genre - %c - comment - %r - copyright -Example: %a - %t [%l]</property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">True</property> - <property name="xalign">0.10000000149</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHButtonBox" id="hbuttonbox1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="button2"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_format_cancel_clicked" last_modification_time="Wed, 23 Dec 2009 21:28:57 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button3"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_format_ok_clicked" last_modification_time="Wed, 23 Dec 2009 21:28:38 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - <widget class="GtkWindow" id="trackproperties"> <property name="visible">True</property> <property name="title" translatable="yes">Track Properties</property> @@ -3292,4 +3014,314 @@ Example: %a - %t [%l]</property> </child> </widget> +<widget class="GtkDialog" id="editcolumndlg"> + <property name="visible">True</property> + <property name="title" translatable="yes">dialog1</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">True</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="cancelbutton1"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">_Cancel</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-6</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="okbutton1"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">_OK</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkTable" id="table9"> + <property name="border_width">3</property> + <property name="visible">True</property> + <property name="n_rows">5</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">3</property> + + <child> + <widget class="GtkLabel" id="label26"> + <property name="visible">True</property> + <property name="label" translatable="yes">Title</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="title"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes">Enter new column title here</property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label37"> + <property name="visible">True</property> + <property name="label" translatable="yes">Type</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="id"> + <property name="visible">True</property> + <property name="items" translatable="yes">Playing +Artist - Album +Artist +Album +Title +Length +Track +Custom</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="fmtlabel"> + <property name="visible">True</property> + <property name="label" translatable="yes">Format</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="format"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Format conversions (start with %): + [a]rtist, [t]itle, al[b]um, track[n]umber, + [l]ength, [y]ear, [g]enre, [c]omment, copy[r]ight +Example: %a - %t [%l]</property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">True</property> + <property name="xalign">0.10000000149</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label38"> + <property name="visible">True</property> + <property name="label" translatable="yes">Alignment</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="align"> + <property name="visible">True</property> + <property name="items" translatable="yes">Left +Right</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + </glade-interface> diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c index a5085d1f..8c822dcc 100644 --- a/plugins/gtkui/gtkplaylist.c +++ b/plugins/gtkui/gtkplaylist.c @@ -1465,6 +1465,7 @@ on_header_button_press_event (GtkWidget *widget, gpointer user_data) { GTKPL_PROLOGUE; + ps->active_column = gtkpl_get_column_for_click (ps, event->x); if (event->button == 1) { // start sizing/dragging header_dragging = -1; @@ -1494,7 +1495,6 @@ on_header_button_press_event (GtkWidget *widget, } } else if (event->button == 3) { - ps->active_column = gtkpl_get_column_for_click (ps, event->x); GtkWidget *menu = create_headermenu (); last_playlist = ps; gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, widget, 3, gtk_get_current_event_time()); @@ -1676,6 +1676,33 @@ gtkpl_column_append (gtkplaylist_t *pl, gtkpl_column_t *c) { } void +gtkpl_column_insert_before (gtkplaylist_t *pl, gtkpl_column_t *before, gtkpl_column_t *c) { + if (pl->columns) { + gtkpl_column_t *prev = NULL; + gtkpl_column_t *next = pl->columns; + while (next) { + if (next == before) { + break; + } + prev = next; + next = next->next; + } + c->next = next; + if (prev) { + prev->next = c; + } + else { + pl->columns = c; + } + gtkpl_column_rewrite_config (pl); + } + else { + pl->columns = c; + gtkpl_column_update_config (pl, c, 0); + } +} + +void gtkpl_column_free (gtkpl_column_t *c) { if (c->title) { free (c->title); diff --git a/plugins/gtkui/gtkplaylist.h b/plugins/gtkui/gtkplaylist.h index 4e1542db..a48ef69f 100644 --- a/plugins/gtkui/gtkplaylist.h +++ b/plugins/gtkui/gtkplaylist.h @@ -224,6 +224,9 @@ void gtkpl_column_append (gtkplaylist_t *pl, gtkpl_column_t *c); void +gtkpl_column_insert_before (gtkplaylist_t *pl, gtkpl_column_t *before, gtkpl_column_t *c); + +void gtkpl_column_remove (gtkplaylist_t *pl, gtkpl_column_t *c); void diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index d7ae9019..d2bfe710 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -1262,6 +1262,7 @@ create_prefwin (void) prefwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request (prefwin, 642, 372); + gtk_container_set_border_width (GTK_CONTAINER (prefwin), 3); gtk_window_set_title (GTK_WINDOW (prefwin), "Preferences"); gtk_window_set_modal (GTK_WINDOW (prefwin), TRUE); gtk_window_set_skip_taskbar_hint (GTK_WINDOW (prefwin), TRUE); @@ -1672,15 +1673,7 @@ create_headermenu (void) { GtkWidget *headermenu; GtkWidget *add_column; - GtkWidget *add_column_menu; - GtkWidget *artist; - GtkWidget *album; - GtkWidget *tracknum; - GtkWidget *duration; - GtkWidget *playing; - GtkWidget *title; - GtkWidget *separator7; - GtkWidget *custom; + GtkWidget *edit_column; GtkWidget *remove_column; headermenu = gtk_menu_new (); @@ -1689,66 +1682,19 @@ create_headermenu (void) gtk_widget_show (add_column); gtk_container_add (GTK_CONTAINER (headermenu), add_column); - add_column_menu = gtk_menu_new (); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_column), add_column_menu); - - artist = gtk_menu_item_new_with_mnemonic ("Artist"); - gtk_widget_show (artist); - gtk_container_add (GTK_CONTAINER (add_column_menu), artist); - - album = gtk_menu_item_new_with_mnemonic ("Album"); - gtk_widget_show (album); - gtk_container_add (GTK_CONTAINER (add_column_menu), album); - - tracknum = gtk_menu_item_new_with_mnemonic ("Track number"); - gtk_widget_show (tracknum); - gtk_container_add (GTK_CONTAINER (add_column_menu), tracknum); - - duration = gtk_menu_item_new_with_mnemonic ("Duration"); - gtk_widget_show (duration); - gtk_container_add (GTK_CONTAINER (add_column_menu), duration); - - playing = gtk_menu_item_new_with_mnemonic ("Playing status"); - gtk_widget_show (playing); - gtk_container_add (GTK_CONTAINER (add_column_menu), playing); - - title = gtk_menu_item_new_with_mnemonic ("Title"); - gtk_widget_show (title); - gtk_container_add (GTK_CONTAINER (add_column_menu), title); - - separator7 = gtk_separator_menu_item_new (); - gtk_widget_show (separator7); - gtk_container_add (GTK_CONTAINER (add_column_menu), separator7); - gtk_widget_set_sensitive (separator7, FALSE); - - custom = gtk_menu_item_new_with_mnemonic ("Custom"); - gtk_widget_show (custom); - gtk_container_add (GTK_CONTAINER (add_column_menu), custom); + edit_column = gtk_menu_item_new_with_mnemonic ("Edit column"); + gtk_widget_show (edit_column); + gtk_container_add (GTK_CONTAINER (headermenu), edit_column); - remove_column = gtk_menu_item_new_with_mnemonic ("Remove this column"); + remove_column = gtk_menu_item_new_with_mnemonic ("Remove column"); gtk_widget_show (remove_column); gtk_container_add (GTK_CONTAINER (headermenu), remove_column); - g_signal_connect ((gpointer) artist, "activate", - G_CALLBACK (on_artist_activate), - NULL); - g_signal_connect ((gpointer) album, "activate", - G_CALLBACK (on_album_activate), - NULL); - g_signal_connect ((gpointer) tracknum, "activate", - G_CALLBACK (on_tracknum_activate), - NULL); - g_signal_connect ((gpointer) duration, "activate", - G_CALLBACK (on_duration_activate), - NULL); - g_signal_connect ((gpointer) playing, "activate", - G_CALLBACK (on_playing_activate), + g_signal_connect ((gpointer) add_column, "activate", + G_CALLBACK (on_add_column_activate), NULL); - g_signal_connect ((gpointer) title, "activate", - G_CALLBACK (on_title_activate), - NULL); - g_signal_connect ((gpointer) custom, "activate", - G_CALLBACK (on_custom_activate), + g_signal_connect ((gpointer) edit_column, "activate", + G_CALLBACK (on_edit_column_activate), NULL); g_signal_connect ((gpointer) remove_column, "activate", G_CALLBACK (on_remove_column_activate), @@ -1757,15 +1703,7 @@ create_headermenu (void) /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (headermenu, headermenu, "headermenu"); GLADE_HOOKUP_OBJECT (headermenu, add_column, "add_column"); - GLADE_HOOKUP_OBJECT (headermenu, add_column_menu, "add_column_menu"); - GLADE_HOOKUP_OBJECT (headermenu, artist, "artist"); - GLADE_HOOKUP_OBJECT (headermenu, album, "album"); - GLADE_HOOKUP_OBJECT (headermenu, tracknum, "tracknum"); - GLADE_HOOKUP_OBJECT (headermenu, duration, "duration"); - GLADE_HOOKUP_OBJECT (headermenu, playing, "playing"); - GLADE_HOOKUP_OBJECT (headermenu, title, "title"); - GLADE_HOOKUP_OBJECT (headermenu, separator7, "separator7"); - GLADE_HOOKUP_OBJECT (headermenu, custom, "custom"); + GLADE_HOOKUP_OBJECT (headermenu, edit_column, "edit_column"); GLADE_HOOKUP_OBJECT (headermenu, remove_column, "remove_column"); return headermenu; @@ -1835,108 +1773,6 @@ create_addlocation (void) } GtkWidget* -create_inputformat (void) -{ - GtkWidget *inputformat; - GtkWidget *vbox8; - GtkWidget *hbox10; - GtkWidget *label26; - GtkWidget *titleentry; - GtkWidget *hbox9; - GtkWidget *format; - GtkWidget *formatentry; - GtkWidget *label25; - GtkWidget *hbuttonbox1; - GtkWidget *button2; - GtkWidget *button3; - - inputformat = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (inputformat), "Column Format"); - gtk_window_set_modal (GTK_WINDOW (inputformat), TRUE); - gtk_window_set_skip_taskbar_hint (GTK_WINDOW (inputformat), TRUE); - gtk_window_set_skip_pager_hint (GTK_WINDOW (inputformat), TRUE); - gtk_window_set_type_hint (GTK_WINDOW (inputformat), GDK_WINDOW_TYPE_HINT_DIALOG); - - vbox8 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox8); - gtk_container_add (GTK_CONTAINER (inputformat), vbox8); - gtk_container_set_border_width (GTK_CONTAINER (vbox8), 4); - - hbox10 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox10); - gtk_box_pack_start (GTK_BOX (vbox8), hbox10, FALSE, FALSE, 0); - - label26 = gtk_label_new ("Title:"); - gtk_widget_show (label26); - gtk_box_pack_start (GTK_BOX (hbox10), label26, FALSE, FALSE, 0); - - titleentry = gtk_entry_new (); - gtk_widget_show (titleentry); - gtk_box_pack_start (GTK_BOX (hbox10), titleentry, TRUE, TRUE, 0); - gtk_entry_set_text (GTK_ENTRY (titleentry), "Enter new column title here"); - gtk_entry_set_invisible_char (GTK_ENTRY (titleentry), 9679); - gtk_entry_set_activates_default (GTK_ENTRY (titleentry), TRUE); - - hbox9 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox9); - gtk_box_pack_start (GTK_BOX (vbox8), hbox9, FALSE, FALSE, 0); - - format = gtk_label_new ("Format:"); - gtk_widget_show (format); - gtk_box_pack_start (GTK_BOX (hbox9), format, FALSE, FALSE, 0); - - formatentry = gtk_entry_new (); - gtk_widget_show (formatentry); - gtk_box_pack_start (GTK_BOX (hbox9), formatentry, TRUE, TRUE, 0); - gtk_entry_set_invisible_char (GTK_ENTRY (formatentry), 9679); - - label25 = gtk_label_new ("Format fields:\n %a - artist\n %t - title\n %b - album\n %n - track\n %l - duration\n %y - year\n %g - genre\n %c - comment\n %r - copyright\nExample: %a - %t [%l]"); - gtk_widget_show (label25); - gtk_box_pack_start (GTK_BOX (vbox8), label25, TRUE, TRUE, 0); - GTK_WIDGET_SET_FLAGS (label25, GTK_CAN_FOCUS); - gtk_label_set_use_markup (GTK_LABEL (label25), TRUE); - gtk_label_set_selectable (GTK_LABEL (label25), TRUE); - gtk_misc_set_alignment (GTK_MISC (label25), 0.1, 0.5); - - hbuttonbox1 = gtk_hbutton_box_new (); - gtk_widget_show (hbuttonbox1); - gtk_box_pack_start (GTK_BOX (vbox8), hbuttonbox1, FALSE, FALSE, 0); - - button2 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_show (button2); - gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2); - GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT); - - button3 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_show (button3); - gtk_container_add (GTK_CONTAINER (hbuttonbox1), button3); - GTK_WIDGET_SET_FLAGS (button3, GTK_CAN_DEFAULT); - - g_signal_connect ((gpointer) button2, "clicked", - G_CALLBACK (on_format_cancel_clicked), - NULL); - g_signal_connect ((gpointer) button3, "clicked", - G_CALLBACK (on_format_ok_clicked), - NULL); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (inputformat, inputformat, "inputformat"); - GLADE_HOOKUP_OBJECT (inputformat, vbox8, "vbox8"); - GLADE_HOOKUP_OBJECT (inputformat, hbox10, "hbox10"); - GLADE_HOOKUP_OBJECT (inputformat, label26, "label26"); - GLADE_HOOKUP_OBJECT (inputformat, titleentry, "titleentry"); - GLADE_HOOKUP_OBJECT (inputformat, hbox9, "hbox9"); - GLADE_HOOKUP_OBJECT (inputformat, format, "format"); - GLADE_HOOKUP_OBJECT (inputformat, formatentry, "formatentry"); - GLADE_HOOKUP_OBJECT (inputformat, label25, "label25"); - GLADE_HOOKUP_OBJECT (inputformat, hbuttonbox1, "hbuttonbox1"); - GLADE_HOOKUP_OBJECT (inputformat, button2, "button2"); - GLADE_HOOKUP_OBJECT (inputformat, button3, "button3"); - - return inputformat; -} - -GtkWidget* create_trackproperties (void) { GtkWidget *trackproperties; @@ -2136,3 +1972,147 @@ create_trackproperties (void) return trackproperties; } +GtkWidget* +create_editcolumndlg (void) +{ + GtkWidget *editcolumndlg; + GtkWidget *dialog_vbox1; + GtkWidget *table9; + GtkWidget *label26; + GtkWidget *title; + GtkWidget *label37; + GtkWidget *id; + GtkWidget *fmtlabel; + GtkWidget *format; + GtkWidget *label25; + GtkWidget *label38; + GtkWidget *align; + GtkWidget *dialog_action_area1; + GtkWidget *cancelbutton1; + GtkWidget *okbutton1; + + editcolumndlg = gtk_dialog_new (); + gtk_window_set_title (GTK_WINDOW (editcolumndlg), "dialog1"); + gtk_window_set_modal (GTK_WINDOW (editcolumndlg), TRUE); + gtk_window_set_type_hint (GTK_WINDOW (editcolumndlg), GDK_WINDOW_TYPE_HINT_DIALOG); + + dialog_vbox1 = GTK_DIALOG (editcolumndlg)->vbox; + gtk_widget_show (dialog_vbox1); + + table9 = gtk_table_new (5, 2, FALSE); + gtk_widget_show (table9); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), table9, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (table9), 3); + gtk_table_set_col_spacings (GTK_TABLE (table9), 3); + + label26 = gtk_label_new ("Title"); + gtk_widget_show (label26); + gtk_table_attach (GTK_TABLE (table9), label26, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label26), 0, 0.5); + + title = gtk_entry_new (); + gtk_widget_show (title); + gtk_table_attach (GTK_TABLE (table9), title, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_text (GTK_ENTRY (title), "Enter new column title here"); + gtk_entry_set_invisible_char (GTK_ENTRY (title), 9679); + gtk_entry_set_activates_default (GTK_ENTRY (title), TRUE); + + label37 = gtk_label_new ("Type"); + gtk_widget_show (label37); + gtk_table_attach (GTK_TABLE (table9), label37, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label37), 0, 0.5); + + id = gtk_combo_box_new_text (); + gtk_widget_show (id); + gtk_table_attach (GTK_TABLE (table9), id, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Playing"); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Artist - Album"); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Artist"); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Album"); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Title"); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Length"); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Track"); + gtk_combo_box_append_text (GTK_COMBO_BOX (id), "Custom"); + + fmtlabel = gtk_label_new ("Format"); + gtk_widget_show (fmtlabel); + gtk_table_attach (GTK_TABLE (table9), fmtlabel, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (fmtlabel), 0, 0.5); + + format = gtk_entry_new (); + gtk_widget_show (format); + gtk_table_attach (GTK_TABLE (table9), format, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_invisible_char (GTK_ENTRY (format), 9679); + gtk_entry_set_activates_default (GTK_ENTRY (format), TRUE); + + label25 = gtk_label_new ("Format conversions (start with %):\n [a]rtist, [t]itle, al[b]um, track[n]umber,\n [l]ength, [y]ear, [g]enre, [c]omment, copy[r]ight\nExample: %a - %t [%l]"); + gtk_widget_show (label25); + gtk_table_attach (GTK_TABLE (table9), label25, 0, 2, 4, 5, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + GTK_WIDGET_SET_FLAGS (label25, GTK_CAN_FOCUS); + gtk_label_set_use_markup (GTK_LABEL (label25), TRUE); + gtk_label_set_selectable (GTK_LABEL (label25), TRUE); + gtk_misc_set_alignment (GTK_MISC (label25), 0.1, 0.5); + + label38 = gtk_label_new ("Alignment"); + gtk_widget_show (label38); + gtk_table_attach (GTK_TABLE (table9), label38, 0, 1, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label38), 0, 0.5); + + align = gtk_combo_box_new_text (); + gtk_widget_show (align); + gtk_table_attach (GTK_TABLE (table9), align, 1, 2, 3, 4, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (align), "Left"); + gtk_combo_box_append_text (GTK_COMBO_BOX (align), "Right"); + + dialog_action_area1 = GTK_DIALOG (editcolumndlg)->action_area; + gtk_widget_show (dialog_action_area1); + gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); + + cancelbutton1 = gtk_button_new_with_mnemonic ("_Cancel"); + gtk_widget_show (cancelbutton1); + gtk_dialog_add_action_widget (GTK_DIALOG (editcolumndlg), cancelbutton1, GTK_RESPONSE_CANCEL); + GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); + + okbutton1 = gtk_button_new_with_mnemonic ("_OK"); + gtk_widget_show (okbutton1); + gtk_dialog_add_action_widget (GTK_DIALOG (editcolumndlg), okbutton1, GTK_RESPONSE_OK); + GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (editcolumndlg, editcolumndlg, "editcolumndlg"); + GLADE_HOOKUP_OBJECT_NO_REF (editcolumndlg, dialog_vbox1, "dialog_vbox1"); + GLADE_HOOKUP_OBJECT (editcolumndlg, table9, "table9"); + GLADE_HOOKUP_OBJECT (editcolumndlg, label26, "label26"); + GLADE_HOOKUP_OBJECT (editcolumndlg, title, "title"); + GLADE_HOOKUP_OBJECT (editcolumndlg, label37, "label37"); + GLADE_HOOKUP_OBJECT (editcolumndlg, id, "id"); + GLADE_HOOKUP_OBJECT (editcolumndlg, fmtlabel, "fmtlabel"); + GLADE_HOOKUP_OBJECT (editcolumndlg, format, "format"); + GLADE_HOOKUP_OBJECT (editcolumndlg, label25, "label25"); + GLADE_HOOKUP_OBJECT (editcolumndlg, label38, "label38"); + GLADE_HOOKUP_OBJECT (editcolumndlg, align, "align"); + GLADE_HOOKUP_OBJECT_NO_REF (editcolumndlg, dialog_action_area1, "dialog_action_area1"); + GLADE_HOOKUP_OBJECT (editcolumndlg, cancelbutton1, "cancelbutton1"); + GLADE_HOOKUP_OBJECT (editcolumndlg, okbutton1, "okbutton1"); + + return editcolumndlg; +} + diff --git a/plugins/gtkui/interface.h b/plugins/gtkui/interface.h index 0ccd4a72..931f74bd 100644 --- a/plugins/gtkui/interface.h +++ b/plugins/gtkui/interface.h @@ -10,5 +10,5 @@ GtkWidget* create_helpwindow (void); GtkWidget* create_prefwin (void); GtkWidget* create_headermenu (void); GtkWidget* create_addlocation (void); -GtkWidget* create_inputformat (void); GtkWidget* create_trackproperties (void); +GtkWidget* create_editcolumndlg (void); |