<property name="can_focus">False</property>
<property name="label" translatable="yes">_Ansicht</property>
<property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckMenuItem" id="showOfflineCheckMenuItem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Show _Offline Contacts</property>
+ <property name="use_underline">True</property>
+ <accelerator key="o" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
<child>
<property name="label" translatable="yes">_Hilfe</property>
<property name="use_underline">True</property>
<child type="submenu">
- <object class="GtkMenu" id="menu3">
+ <object class="GtkMenu" id="menu4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">RosterTreeModelFilter</property>
+ <property name="headers_visible">False</property>
<property name="search_column">0</property>
<property name="tooltip_column">3</property>
<child internal-child="selection">
<child>
<object class="GtkTreeViewColumn" id="RosterTreeViewColumn1">
<property name="title" translatable="yes">Status</property>
+ <property name="expand">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<child>
<object class="GtkTreeViewColumn" id="RosterTreeViewColumn2">
<property name="title" translatable="yes">Name</property>
+ <property name="expand">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext2"/>
<attributes>
</child>
<child>
<object class="GtkTreeViewColumn" id="RosterTreeViewColumn3">
+ <property name="sizing">fixed</property>
+ <property name="fixed_width">32</property>
<property name="title" translatable="yes">Avatar</property>
<child>
- <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
+ <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1">
+ <property name="width">32</property>
+ <property name="height">32</property>
+ </object>
<attributes>
<attribute name="pixbuf">4</attribute>
</attributes>
OFMapTable *_subDialogMap;
OFMutableDictionary *_contactMap;
JubChatClient *_client;
+ bool _showOffline;
}
+@property (assign) bool showOffline;
- initWithClient: (JubChatClient*)client;
- (void)client: (JubChatClient*)client
static gboolean filter_roster_by_presence(GtkTreeModel *model,
GtkTreeIter *iter, gpointer data)
{
+ bool *showOffline = data;
char *status;
gtk_tree_model_get(model, iter, 2, &status, -1);
if (!status)
return TRUE;
- if (!strcmp(status, "unavailable"))
+ if (!*showOffline && !strcmp(status, "unavailable"))
return FALSE;
return TRUE;
}
+static void menu_show_offline(GtkCheckMenuItem *checkmenuitem, gpointer data)
+{
+ JubGtkRosterUI *ui = data;
+ ui.showOffline = gtk_check_menu_item_get_active(checkmenuitem);
+}
+
static void dialog_response_callback(GtkDialog *dialog, gint response_id,
gpointer user_data)
{
self = [super init];
@try {
+ GtkCheckMenuItem *show_offline_menu_item;
GtkTreeView *roster_view;
GtkBuilder *builder;
gtk_builder_get_object(builder, "RosterTreeModelFilter"));
gtk_tree_model_filter_set_visible_func(_roster_filter,
- filter_roster_by_presence, NULL, NULL);
+ filter_roster_by_presence, &_showOffline, NULL);
roster_view = GTK_TREE_VIEW(gtk_builder_get_object(builder,
"RosterTreeView"));
g_signal_connect(_presence_combo, "changed",
G_CALLBACK(presence_changed), client);
+ show_offline_menu_item =
+ GTK_CHECK_MENU_ITEM(gtk_builder_get_object(builder,
+ "showOfflineCheckMenuItem"));
+
+ g_signal_connect(show_offline_menu_item, "toggled",
+ G_CALLBACK(menu_show_offline), self);
+
g_object_unref(G_OBJECT(builder));
} @catch (id e) {
[self release];
OFArray *groups = contact.rosterItem.groups;;
GdkPixbuf *avatar =
- gdk_pixbuf_new_from_file([avatarFile UTF8String], NULL);
+ gdk_pixbuf_new_from_file_at_size([avatarFile UTF8String],
+ 32, 32, NULL);
if (groups == nil)
groups = @[ @"General" ];
[tooltip UTF8String]);
});
}
+
+- (bool)showOffline
+{
+ OF_GETTER(_showOffline, YES);
+}
+
+- (void)setShowOffline: (bool)showOffline
+{
+ _showOffline = showOffline;
+ g_idle_add_block(^{
+ gtk_tree_model_filter_refilter(_roster_filter);
+ });
+}
@end