$ git clone https://tcclient.ion.nu/tc_client.git
commit cc1ca43bf246a3bdedcc10b1c435feb33ecf450b
Author: Alicia <...>
Date: Wed Jun 10 15:03:05 2015 +0200
tc_client-gtk: if there are no saved channels, show a placeholder text instructing how to add a channel.
diff --git a/ChangeLog b/ChangeLog
index 3444de8..363325a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ modbot: fixed finding the duration of videos longer than 59 minutes (conversion
tc_client-gtk: redesigned the startup window to better support frequenting multiple channels.
tc_client-gtk and camviewer: added compatibility code to build on windows (for now the tc_client core still needs to be built with cygwin for windows)
tc_client-gtk: made the options for notifications and youtube videos work for windows.
+tc_client-gtk: if there are no saved channels, show a placeholder text instructing how to add a channel.
0.32:
Added an 'install' make target, adjusted utilities to run tc_client from PATH unless they were run from the build directory (i.e. './<executable>')
Provide feedback on the /ban command.
diff --git a/gtkgui.glade b/gtkgui.glade
index 1e20f07..e817f1b 100644
--- a/gtkgui.glade
+++ b/gtkgui.glade
@@ -289,6 +289,22 @@
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="channel_placeholder">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">No channels have been added yet, click Channel and then Add to add one.</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="size" value="12000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/utilities/gtk/camviewer.c b/utilities/gtk/camviewer.c
index 5ee6e56..aaa616d 100644
--- a/utilities/gtk/camviewer.c
+++ b/utilities/gtk/camviewer.c
@@ -957,6 +957,10 @@ int main(int argc, char** argv)
// Populate saved channels
GtkWidget* startbox=GTK_WIDGET(gtk_builder_get_object(gui, "startbox"));
int channelcount=config_get_int("channelcount");
+ if(channelcount)
+ {
+ gtk_widget_destroy(GTK_WIDGET(gtk_builder_get_object(gui, "channel_placeholder")));
+ }
char buf[256];
int i;
for(i=0; i<channelcount; ++i)
diff --git a/utilities/gtk/gui.c b/utilities/gtk/gui.c
index dad17fe..0b8dbfd 100644
--- a/utilities/gtk/gui.c
+++ b/utilities/gtk/gui.c
@@ -152,6 +152,8 @@ void savechannel(GtkButton* button, void* x)
if(x==(void*)-1)
{
+ GtkWidget* placeholder=GTK_WIDGET(gtk_builder_get_object(gui, "channel_placeholder"));
+ if(placeholder){gtk_widget_destroy(placeholder);}
GtkWidget* startbox=GTK_WIDGET(gtk_builder_get_object(gui, "startbox"));
GtkWidget* box=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
#ifdef GTK_STYLE_CLASS_LINKED