Skip to content

Commit

Permalink
[FreetuxTV] Start window to update TV channels database.
Browse files Browse the repository at this point in the history
  • Loading branch information
eric.beuque committed Nov 11, 2012
1 parent a5a547d commit c0ca114
Show file tree
Hide file tree
Showing 6 changed files with 532 additions and 11 deletions.
290 changes: 290 additions & 0 deletions data/ui/tvchannelsdatabase.glade
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkAction" id="action1"/>
<object class="GtkDialog" id="dialogtvchannelsdatabase">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button_close">
<property name="label">gtk-close</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_apply">
<property name="label">gtk-apply</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame1">
<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="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<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="left_padding">12</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;This will re-associate each stream with a TV Channel in the current database. This allow to associate a logo to a channel.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="checkbutton2">
<property name="label" translatable="yes">Update database from file:</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</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">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry1">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="text" translatable="yes">http://freetuxtv.googlecode.com/svn/trunk/data/tv_channels.xml</property>
<property name="invisible_char_set">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkCheckButton" id="checkbutton_synchronize">
<property name="label" translatable="yes"> Synchronize TV Channel database</property>
<property name="use_action_appearance">False</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="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<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="GtkBox" id="box5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;This will download each logos recorded in the local database from the remote database.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Remote directory:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry2">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="text" translatable="yes">http://freetuxtv.googlecode.com/svn/trunk/data/images/channels/</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkCheckButton" id="checkbutton3">
<property name="label" translatable="yes">Update logos list</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</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>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;TV Channels database&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">button_close</action-widget>
<action-widget response="0">button_apply</action-widget>
</action-widgets>
</object>
</interface>
6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ freetuxtv_SOURCES = \
freetuxtv-utils.h \
freetuxtv-window-add-channels-group.c \
freetuxtv-window-add-channels-group.h \
freetuxtv-window-add-recording.c \
freetuxtv-window-add-recording.h \
freetuxtv-window-channel-properties.c \
freetuxtv-window-channel-properties.h \
freetuxtv-window-main.c \
freetuxtv-window-main.h \
freetuxtv-window-add-recording.c \
freetuxtv-window-add-recording.h \
freetuxtv-window-tv-channels-database.c \
freetuxtv-window-tv-channels-database.h \
lib-gmmkeys.c \
lib-gmmkeys.h \
lib-m3uparser.c \
Expand Down
1 change: 1 addition & 0 deletions src/freetuxtv-gladexml.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define FREETUXTV_GUIFILE_ADDRECORDING "addrecording.glade"
#define FREETUXTV_GUIFILE_ADDCHANNELSGROUPS "addchannelsgroups.glade"
#define FREETUXTV_GUIFILE_CHANNELPROPERTIES "channelproperties.glade"
#define FREETUXTV_GUIFILE_TVCHANNELSDATABASE "tvchannelsdatabase.glade"

// List of windows and dialogs
#define FREETUXTV_GUI_DIALOG_ADDRECORDING "dialogaddrecording"
18 changes: 9 additions & 9 deletions src/freetuxtv-window-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "freetuxtv-window-main.h"
#include "freetuxtv-window-add-recording.h"
#include "freetuxtv-window-add-channels-group.h"
#include "freetuxtv-window-tv-channels-database.h"

#include "freetuxtv-app.h"
#include "freetuxtv-i18n.h"
Expand Down Expand Up @@ -1582,20 +1583,19 @@ on_windowmain_menuitemupdatetvchannels_activate (GtkMenuItem *menuitem,
FreetuxTVApp *app = (FreetuxTVApp *) user_data;

GError* error = NULL;

GtkWindow* pWindow;
GtkWidget* pParent;
pParent = (GtkWidget *) gtk_builder_get_object (app->gui, "windowmain");

DBSync dbsync;
dbsync_open_db (&dbsync, &error);

if(error == NULL){
tvchannels_list_synchronize (app, &dbsync, &error);
}
FreetuxTVWindowTVChannelsDatabase* pWindowTVChannelsDatabase;
pWindowTVChannelsDatabase = freetuxtv_window_tv_channels_database_new(GTK_WINDOW(pParent), app);

if(error == NULL){
channels_list_load_channels (app, &dbsync, &error);
pWindow = gtk_builder_window_get_top_window (GTK_BUILDER_WINDOW(pWindowTVChannelsDatabase));
gtk_widget_show(GTK_WIDGET(pWindow));
}

dbsync_close_db(&dbsync);

if(error != NULL){
windowmain_show_gerror (app, error);
g_error_free (error);
Expand Down
Loading

0 comments on commit c0ca114

Please sign in to comment.