Exemplo n.º 1
0
static void
vnr_message_area_show_basic (VnrMessageArea *msg_area,
                             gboolean critical,
                             const char *message, gboolean close_image)
{
    char *warning;
    if(!msg_area->initialized)
    {
        vnr_message_area_initialize(msg_area);
    }

    msg_area->is_critical = critical;

    if(critical)
        gtk_image_set_from_stock (GTK_IMAGE(msg_area->image),
                                  GTK_STOCK_DIALOG_ERROR,
                                  GTK_ICON_SIZE_DIALOG);
    else
        gtk_image_set_from_stock (GTK_IMAGE(msg_area->image),
                                  GTK_STOCK_DIALOG_INFO,
                                  GTK_ICON_SIZE_DIALOG);

    msg_area->is_critical = critical;

    warning = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
                                       message);

    gtk_label_set_markup(GTK_LABEL(msg_area->message), warning);

    g_free (warning);
    if(close_image == TRUE)
        vnr_window_close(msg_area->vnr_win);
}
Exemplo n.º 2
0
static void image_fullscreen_button ( GtkWidget *widget, AnypaperPreview *preview)
{
	GtkWidget *button, *image_button;

	button = widget;

	if (preview->priv->state == WINDOW_NORMAL_STATE)
	{
		gtk_button_set_label (GTK_BUTTON(button), GTK_STOCK_LEAVE_FULLSCREEN);
		image_button = gtk_button_get_image (GTK_BUTTON(button));
		gtk_image_set_from_stock (GTK_IMAGE(image_button), GTK_STOCK_LEAVE_FULLSCREEN, GTK_ICON_SIZE_BUTTON);
		gtk_widget_show(image_button);gtk_widget_hide(preview->priv->hbox);
		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(preview->priv->window2), GTK_POLICY_NEVER, GTK_POLICY_NEVER);
		preview->priv->state = WINDOW_FULLSCREEN_STATE;
	}
	else
	{
		gtk_button_set_label (GTK_BUTTON(button), GTK_STOCK_FULLSCREEN);
		image_button = gtk_button_get_image (GTK_BUTTON(button));
		gtk_image_set_from_stock (GTK_IMAGE(image_button), GTK_STOCK_FULLSCREEN, GTK_ICON_SIZE_BUTTON);
		gtk_widget_show(image_button);gtk_widget_show(preview->priv->hbox);
		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(preview->priv->window2), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
		preview->priv->state = WINDOW_NORMAL_STATE;
	}
}
Exemplo n.º 3
0
static void
update_play_button (GthMediaViewerPage *self,
		    GstState            new_state)
{
	if (! self->priv->playing && (new_state == GST_STATE_PLAYING)) {
		self->priv->playing = TRUE;
		gtk_image_set_from_stock (GTK_IMAGE (GET_WIDGET ("button_play_image")), GTK_STOCK_MEDIA_PAUSE, GTK_ICON_SIZE_LARGE_TOOLBAR);
		gtk_widget_set_tooltip_text (GET_WIDGET ("button_play_image"), _("Pause"));

		if (self->priv->update_progress_id == 0)
			self->priv->update_progress_id = gdk_threads_add_timeout (PROGRESS_DELAY, update_progress_cb, self);
	}
	else if (self->priv->playing && (new_state != GST_STATE_PLAYING)) {
		self->priv->playing = FALSE;
		gtk_image_set_from_stock (GTK_IMAGE (GET_WIDGET ("button_play_image")), GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_LARGE_TOOLBAR);
		gtk_widget_set_tooltip_text (GET_WIDGET ("button_play_image"), _("Play"));

		if (self->priv->update_progress_id != 0) {
			 g_source_remove (self->priv->update_progress_id);
			 self->priv->update_progress_id = 0;
		}
	}

	gth_viewer_page_update_sensitivity (GTH_VIEWER_PAGE (self));
}
Exemplo n.º 4
0
Arquivo: common.c Projeto: dnet/slowrx
// Another device selected from list
void evt_changeDevices() {

  int status;

  pcm.BufferDrop = FALSE;
  Abort = TRUE;

  pthread_join(thread1, NULL);

  if (pcm.handle != NULL) snd_pcm_close(pcm.handle);

  status = initPcmDevice(gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(gui.combo_card)));


  switch(status) {
    case 0:
      gtk_image_set_from_stock(GTK_IMAGE(gui.image_devstatus),GTK_STOCK_YES,GTK_ICON_SIZE_SMALL_TOOLBAR);
      gtk_widget_set_tooltip_text(gui.image_devstatus, "Device successfully opened");
      break;
    case -1:
      gtk_image_set_from_stock(GTK_IMAGE(gui.image_devstatus),GTK_STOCK_DIALOG_WARNING,GTK_ICON_SIZE_SMALL_TOOLBAR);
      gtk_widget_set_tooltip_text(gui.image_devstatus, "Device was opened, but doesn't support 44100 Hz");
      break;
    case -2:
      gtk_image_set_from_stock(GTK_IMAGE(gui.image_devstatus),GTK_STOCK_DIALOG_ERROR,GTK_ICON_SIZE_SMALL_TOOLBAR);
      gtk_widget_set_tooltip_text(gui.image_devstatus, "Failed to open device");
      break;
  }

  g_key_file_set_string(config,"slowrx","device",gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(gui.combo_card)));

  pthread_create (&thread1, NULL, Listen, NULL);

}
Exemplo n.º 5
0
static gboolean permission_checker_thread (gpointer data) {
    if (permission_check_requested == TRUE) {
        //the answer hasn't arrived yet
        return TRUE;

    } else {
        //the answer has arrived
        g_assert(perm_result != PERMISSION_UNKNOWN);

        if (perm_result == PERMISSION_ALLOWED) {
            gtk_image_set_from_stock(GTK_IMAGE(permission_status_icon), GTK_STOCK_YES, GTK_ICON_SIZE_SMALL_TOOLBAR);

            gchar *markup = g_markup_printf_escaped(_("OK. Scrobbling for user: %s"), username);

            gtk_label_set_markup(GTK_LABEL(permission_status_label), markup);
            gtk_widget_set_sensitive(revoke_button, TRUE);

        } else if (perm_result == PERMISSION_DENIED) {

            gtk_image_set_from_stock(GTK_IMAGE(permission_status_icon),  GTK_STOCK_NO,   GTK_ICON_SIZE_SMALL_TOOLBAR);
            gtk_image_set_from_stock(GTK_IMAGE(additional_details_icon), GTK_STOCK_INFO, GTK_ICON_SIZE_SMALL_TOOLBAR);


            gtk_label_set_label(GTK_LABEL(permission_status_label), _("Permission Denied"));

            gtk_label_set_markup(GTK_LABEL(details_label_first), _("Access the following link to allow Audacious to scrobble your plays:"));

            gchar *url = g_markup_printf_escaped("http://www.last.fm/api/auth/?api_key=%s&token=%s", SCROBBLER_API_KEY, request_token);

            gtk_link_button_set_uri(GTK_LINK_BUTTON(url_button), url);
            gtk_button_set_label(GTK_BUTTON(url_button), url);
            gtk_widget_show(url_button);
            g_free(url);

            gtk_label_set_markup(GTK_LABEL(details_label_second), _("Keep this window open and click 'Check Permission' again.\n"));

            gtk_label_set_label(GTK_LABEL(additional_details_label),
                                _("Don't worry. Your scrobbles are saved on your computer.\n"
                                  "They will be submitted as soon as Audacious is allowed to do so."));

        } else if (perm_result == PERMISSION_NONET) {
            gtk_image_set_from_stock(GTK_IMAGE(permission_status_icon),  GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
            gtk_image_set_from_stock(GTK_IMAGE(additional_details_icon), GTK_STOCK_INFO, GTK_ICON_SIZE_SMALL_TOOLBAR);


            gtk_label_set_label(GTK_LABEL(permission_status_label), _("Network Problem."));
            gtk_label_set_label(GTK_LABEL(details_label_first),     _("There was a problem contacting Last.fm. Please try again later."));
            gtk_label_set_label(GTK_LABEL(additional_details_label),
                    _("Don't worry. Your scrobbles are saved on your computer.\n"
                      "They will be submitted as soon as Audacious is allowed to do so."));
        }

        perm_result = PERMISSION_UNKNOWN;
        gtk_widget_set_sensitive(button, TRUE);

        return FALSE;
    }
}
Exemplo n.º 6
0
void on_models_ident_changed(GtkEntry *entry, Logbook *logbook)
{
  entry_clamp_models_ident(entry);
  if (models_ident_validate(logbook)) {
    gtk_image_set_from_stock(GTK_IMAGE(logbook->models_ident_valid_wart), IMAGE_INVAL ,GTK_ICON_SIZE_BUTTON);
  } else {
    gtk_image_set_from_stock(GTK_IMAGE(logbook->models_ident_valid_wart), IMAGE_KEY ,GTK_ICON_SIZE_BUTTON);
  }
  edctrl_set_modified(logbook->models_edctrl);
}
Exemplo n.º 7
0
static void
gimmix_status_changed (MpdObj *mo, ChangedStatusType id)
{
	if (id&MPD_CST_SONGID)
	{	
		gimmix_set_song_info ();
		gimmix_update_current_playlist ();
	}

	if (id&MPD_CST_STATE)
	{
		int state = mpd_player_get_state (gmo);
		if (state == MPD_PLAYER_PLAY)
		{
			gtk_image_set_from_stock (GTK_IMAGE(image_play), "gtk-media-pause", GTK_ICON_SIZE_BUTTON);
			gtk_tooltips_set_tip (play_button_tooltip, play_button, _("Pause <x or c>"), NULL);
			gimmix_set_song_info ();
		}
		if (state == MPD_PLAYER_PAUSE)
		{
			gtk_image_set_from_stock (GTK_IMAGE(image_play), "gtk-media-play", GTK_ICON_SIZE_BUTTON);
			gtk_tooltips_set_tip (play_button_tooltip, play_button, _("Play <x or c>"), NULL);
		}
		if (state == MPD_PLAYER_STOP)
		{
			gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(progress), 0.0);
			gtk_progress_bar_set_text (GTK_PROGRESS_BAR(progress), _("Stopped"));
			if (strncasecmp(cfg_get_key_value(conf, "enable_systray"), "true", 4) == 0)
			{
				gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(tooltip->progressbar), 0.0);
				gtk_progress_bar_set_text (GTK_PROGRESS_BAR(tooltip->progressbar), _("Stopped"));
			}
			gimmix_show_ver_info ();
			
			gtk_image_set_from_stock (GTK_IMAGE(image_play), "gtk-media-play", GTK_ICON_SIZE_BUTTON);
			gtk_tooltips_set_tip (play_button_tooltip, play_button, _("Play <x or c>"), NULL);
		}
		g_object_ref_sink (play_button_tooltip);
		gimmix_update_current_playlist ();
	}
	
	if (id&MPD_CST_PLAYLIST)
		gimmix_update_current_playlist ();

	if (id&MPD_CST_VOLUME)
		gimmix_update_volume ();

	if (id&MPD_CST_RANDOM)
		gimmix_update_shuffle ();

	if (id&MPD_CST_REPEAT)
		gimmix_update_repeat ();

	return;
}
Exemplo n.º 8
0
static void 
workspaceview_refresh( vObject *vobject )
{
	Workspaceview *wview = WORKSPACEVIEW( vobject );
	Workspace *ws = WORKSPACE( VOBJECT( wview )->iobject );

#ifdef DEBUG
	printf( "workspaceview_refresh: %p %s\n", ws, IOBJECT( ws )->name );
#endif /*DEBUG*/

	gtk_widget_set_sensitive( GTK_WIDGET( wview ), !ws->locked );

	workspace_jump_update( ws, wview->popup_jump );

	if( ws->rpane_open && !wview->rpane->open )
		pane_animate_open( wview->rpane );
	if( !ws->rpane_open && wview->rpane->open )
		pane_animate_closed( wview->rpane );

	if( ws->lpane_open && !wview->lpane->open )
		pane_animate_open( wview->lpane );
	if( !ws->lpane_open && wview->lpane->open )
		pane_animate_closed( wview->lpane );

	if( wview->label ) {
		gtk_label_set_text( GTK_LABEL( wview->label ),
			IOBJECT( ws )->name );

		if( IOBJECT( ws )->caption )
			set_tooltip( wview->label, 
				"%s", IOBJECT( ws )->caption );

		if( ws->locked ) 
			gtk_image_set_from_stock( GTK_IMAGE( wview->padlock ), 
				STOCK_LOCK, GTK_ICON_SIZE_MENU );
		else
			gtk_image_clear( GTK_IMAGE( wview->padlock ) );  

		if( ws->errors ) 
			gtk_image_set_from_stock( GTK_IMAGE( wview->alert ), 
				STOCK_ALERT, GTK_ICON_SIZE_MENU );
		else
			gtk_image_clear( GTK_IMAGE( wview->alert ) );  

	}

	VOBJECT_CLASS( parent_class )->refresh( vobject );
}
Exemplo n.º 9
0
static void
avatar_chooser_update_preview_cb (GtkFileChooser       *file_chooser,
				  EmpathyAvatarChooser *chooser)
{
	gchar *filename;

	filename = gtk_file_chooser_get_preview_filename (file_chooser);

	if (filename) {
		GtkWidget *image;
		GdkPixbuf *pixbuf = NULL;
		GdkPixbuf *scaled_pixbuf;

		pixbuf = gdk_pixbuf_new_from_file (filename, NULL);

		image = gtk_file_chooser_get_preview_widget (file_chooser);

		if (pixbuf) {
			scaled_pixbuf = empathy_pixbuf_scale_down_if_necessary (pixbuf, AVATAR_SIZE_SAVE);
			gtk_image_set_from_pixbuf (GTK_IMAGE (image), scaled_pixbuf);
			g_object_unref (scaled_pixbuf);
			g_object_unref (pixbuf);
		} else {
			gtk_image_set_from_stock (GTK_IMAGE (image),
						  "gtk-dialog-question",
						  GTK_ICON_SIZE_DIALOG);
		}

		g_free (filename);
	}

	gtk_file_chooser_set_preview_widget_active (file_chooser, TRUE);
}
Exemplo n.º 10
0
static void 
update_icon (SeahorseApplet *sapplet)
{
    SeahorseAppletPrivate *priv = SEAHORSE_APPLET_GET_PRIVATE (sapplet);
    const char *stock = NULL;
    
    if (seahorse_gconf_get_boolean (SHOW_CLIPBOARD_STATE_KEY)) {
        switch (priv->clipboard_contents) {
        case SEAHORSE_TEXT_TYPE_NONE:
            stock = ICON_CLIPBOARD_UNKNOWN;
            break;
        case SEAHORSE_TEXT_TYPE_PLAIN:
            stock = ICON_CLIPBOARD_TEXT;
            break;
        case SEAHORSE_TEXT_TYPE_KEY:
            stock = ICON_CLIPBOARD_KEY;
            break;
        case SEAHORSE_TEXT_TYPE_MESSAGE:
            stock = ICON_CLIPBOARD_ENCRYPTED;
            break;
        case SEAHORSE_TEXT_TYPE_SIGNED:
            stock = ICON_CLIPBOARD_SIGNED;
            break;
        default:
            g_assert_not_reached ();
            return;
        };
        
    } else {
        stock = ICON_CLIPBOARD_DEFAULT;
    }
    
    gtk_image_set_from_stock (GTK_IMAGE (priv->image), stock, GTK_ICON_SIZE_LARGE_TOOLBAR);
}
Exemplo n.º 11
0
static void
gimp_file_entry_check_filename (GimpFileEntry *entry)
{
  gchar    *utf8;
  gchar    *filename;
  gboolean  exists;

  if (! entry->check_valid || ! entry->file_exists)
    return;

  utf8 = gtk_editable_get_chars (GTK_EDITABLE (entry->entry), 0, -1);
  filename = g_filename_from_utf8 (utf8, -1, NULL, NULL, NULL);
  g_free (utf8);

  if (entry->dir_only)
    exists = g_file_test (filename, G_FILE_TEST_IS_DIR);
  else
    exists = g_file_test (filename, G_FILE_TEST_IS_REGULAR);

  g_free (filename);

  gtk_image_set_from_stock (GTK_IMAGE (entry->file_exists),
                            exists ? GTK_STOCK_YES : GTK_STOCK_NO,
                            GTK_ICON_SIZE_BUTTON);
}
Exemplo n.º 12
0
static void
pidgin_mini_dialog_set_property(GObject *object,
                                guint property_id,
                                const GValue *value,
                                GParamSpec *pspec)
{
	PidginMiniDialog *self = PIDGIN_MINI_DIALOG(object);
	PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);

	switch (property_id) {
		case PROP_TITLE:
			mini_dialog_set_title(self, g_value_get_string(value));
			break;
		case PROP_DESCRIPTION:
			mini_dialog_set_description(self, g_value_get_string(value));
			break;
		case PROP_ICON_NAME:
			gtk_image_set_from_stock(priv->icon, g_value_get_string(value),
				gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
			break;
		case PROP_CUSTOM_ICON:
			gtk_image_set_from_pixbuf(priv->icon, g_value_get_object(value));
			break;
		case PROP_ENABLE_DESCRIPTION_MARKUP:
			priv->enable_description_markup = g_value_get_boolean(value);
			break;
		default:
			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
	}
}
Exemplo n.º 13
0
static void
image_clicked_cb (GtkWidget *widget, gpointer data)
{
  gtk_image_set_from_stock (GTK_IMAGE (gtk_image_menu_item_get_image (
                            GTK_IMAGE_MENU_ITEM (widget))),
                            GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
}
Exemplo n.º 14
0
static void
set_item_stock (GtkWidget  *mi,
                const char *stock_id)
{
  GtkWidget *image;

  image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (mi));

  if (stock_id == NULL)
    {
      if (image != NULL)
        gtk_widget_destroy (image);
      return;
    }

  if (image == NULL)
    {
      image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
      gtk_widget_show (image);
      gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), image);
    }
  else
    {
      gtk_image_set_from_stock (GTK_IMAGE (image), stock_id,
                                GTK_ICON_SIZE_MENU);
    }
}
Exemplo n.º 15
0
GtkWidget *
picture_create_widget (GtkWidget * dlg)
{
  GtkWidget *sw;

  sw = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_NONE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), options.hscroll_policy, options.vscroll_policy);

  viewport = gtk_viewport_new (gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (sw)),
                               gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw)));
  gtk_container_add (GTK_CONTAINER (sw), viewport);

  picture = gtk_image_new ();
  gtk_container_add (GTK_CONTAINER (viewport), picture);

  /* load picture */
  if (options.common_data.uri &&
      g_file_test (options.common_data.uri, G_FILE_TEST_EXISTS))
    load_picture (options.common_data.uri);
  else
    gtk_image_set_from_stock (GTK_IMAGE (picture), "gtk-missing-image", GTK_ICON_SIZE_DIALOG);

  if (loaded && !animated)
    {
      create_popup_menu ();
      g_signal_connect (G_OBJECT (viewport), "button-press-event", G_CALLBACK (button_handler), NULL);
      g_signal_connect (G_OBJECT (viewport), "key-press-event", G_CALLBACK (key_handler), NULL);
    }

  return sw;
}
Exemplo n.º 16
0
static void
update_image_preview (GtkFileChooser *chooser)
{
	GtkWidget *image;
	gchar *file;

	image = gtk_file_chooser_get_preview_widget (GTK_FILE_CHOOSER (chooser));
	file = gtk_file_chooser_get_preview_uri (chooser);

	if (file != NULL)
	{

		GdkPixbuf *pixbuf = NULL;

		pixbuf = create_preview_pixbuf (file);
		g_free (file);

		if (pixbuf != NULL)
		{
			gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
			g_object_unref (pixbuf);
		}
		else
		{
			gtk_image_set_from_stock (GTK_IMAGE (image),
			                          "gtk-dialog-question",
			                          GTK_ICON_SIZE_DIALOG);
		}
	}
	gtk_file_chooser_set_preview_widget_active (chooser, file != NULL);
}
Exemplo n.º 17
0
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
	GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
	GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
	GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
	guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
	
	display_peer_name_in_label(callee,linphone_call_get_remote_address (call));

	gtk_widget_show(linphone_gtk_get_widget(callview,"mute_pause_buttons"));
	gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	gtk_label_set_markup(GTK_LABEL(status),_("<b>In call</b>"));

	gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
	if (pbuf!=NULL){
		gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
		g_object_unref(G_OBJECT(pbuf));
	}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_EXECUTE,GTK_ICON_SIZE_DIALOG);
	linphone_gtk_enable_mute_button(
					GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),TRUE);
	if (taskid==0){
		taskid=g_timeout_add(250,(GSourceFunc)linphone_gtk_in_call_view_refresh,call);
		g_object_set_data(G_OBJECT(callview),"taskid",GINT_TO_POINTER(taskid));
	}
}
Exemplo n.º 18
0
void linphone_gtk_in_call_view_show_encryption(LinphoneCall *call){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *encryption_box=linphone_gtk_get_widget(callview,"encryption_box");
	GtkWidget *label=linphone_gtk_get_widget(callview,"encryption_label");
	GtkWidget *status_icon=linphone_gtk_get_widget(callview,"encryption_status_icon");
	GtkWidget *verify_button=linphone_gtk_get_widget(callview,"encryption_verify_button");
	LinphoneMediaEncryption me=linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
	bool_t verified=linphone_call_get_authentication_token_verified(call);
	switch(me){
		case LinphoneMediaEncryptionSRTP:
			gtk_widget_show_all(encryption_box);
			gtk_label_set_markup(GTK_LABEL(label),_("Secured by SRTP"));
			gtk_widget_hide(status_icon);
			gtk_widget_hide(verify_button);
		break;
		case LinphoneMediaEncryptionZRTP:
		{
			gchar *text=g_strdup_printf(_("Secured by ZRTP - [auth token: %s]"),linphone_call_get_authentication_token(call));
			gtk_label_set_markup(GTK_LABEL(label),text);
			g_free(text);
			gtk_image_set_from_stock(GTK_IMAGE(status_icon),
			                          verified ? GTK_STOCK_APPLY : GTK_STOCK_DIALOG_WARNING,GTK_ICON_SIZE_MENU);
			gtk_button_set_label(GTK_BUTTON(verify_button),
			                     verified ? _("Set unverified") : _("Set verified"));
			gtk_widget_show_all(encryption_box);
		}	
		break;
		default:
			gtk_widget_hide_all(encryption_box);
	}
}
Exemplo n.º 19
0
static void
set_new_pixbuf(VnrPropertiesDialog *dialog, GdkPixbuf* original)
{
    if(dialog->thumbnail != NULL)
    {
        g_object_unref(dialog->thumbnail);
        dialog->thumbnail = NULL;
    }

    if(original == NULL)
    {
        gtk_image_set_from_stock(GTK_IMAGE(dialog->image), GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_DIALOG);
        return;
    }

    int width, height;

    width = gdk_pixbuf_get_width (original);
    height = gdk_pixbuf_get_height (original);

    vnr_tools_fit_to_size(&height, &width, 100,100);

    dialog->thumbnail = gdk_pixbuf_scale_simple (original, width, height,
                                                 GDK_INTERP_NEAREST);
}
Exemplo n.º 20
0
void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call, bool_t with_pause){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
	GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
	GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
	GtkWidget *answer_button;
	GtkWidget *image;

	gtk_label_set_markup(GTK_LABEL(status),_("<b>Incoming call</b>"));
	gtk_widget_show_all(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	gtk_widget_hide(linphone_gtk_get_widget(callview,"mute_pause_buttons"));
	display_peer_name_in_label(callee,linphone_call_get_remote_address (call));

	answer_button=linphone_gtk_get_widget(callview,"accept_call");
	image=create_pixmap (linphone_gtk_get_ui_config("start_call_icon","startcall-green.png"));
	if (with_pause){
		gtk_button_set_label(GTK_BUTTON(answer_button),
		                     _("Pause all calls\nand answer"));
	}else gtk_button_set_label(GTK_BUTTON(answer_button),_("Answer"));
	gtk_button_set_image(GTK_BUTTON(answer_button),image);
	gtk_widget_show(image);
	
	image=create_pixmap (linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"));
	gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(callview,"decline_call")),image);
	gtk_widget_show(image);
	
	if (pbuf!=NULL){
		gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
		g_object_unref(G_OBJECT(pbuf));
	}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_EXECUTE,GTK_ICON_SIZE_DIALOG);
}
Exemplo n.º 21
0
static void
selection_changed (GtkTreeSelection *selection)
{
  GtkTreeView *treeview;
  StockItemDisplay *display;
  GtkTreeModel *model;
  GtkTreeIter iter;
  
  treeview = gtk_tree_selection_get_tree_view (selection);
  display = g_object_get_data (G_OBJECT (treeview), "stock-display");

  if (gtk_tree_selection_get_selected (selection, &model, &iter))
    {
      StockItemInfo *info;
      gchar *str;
      
      gtk_tree_model_get (model, &iter,
                          0, &info,
                          -1);

      if (info->small_icon && info->item.label)
        gtk_label_set_text (GTK_LABEL (display->type_label), "Icon and Item");
      else if (info->small_icon)
        gtk_label_set_text (GTK_LABEL (display->type_label), "Icon Only");
      else if (info->item.label)
        gtk_label_set_text (GTK_LABEL (display->type_label), "Item Only");
      else
        gtk_label_set_text (GTK_LABEL (display->type_label), "???????");

      gtk_label_set_text (GTK_LABEL (display->macro_label), info->macro);
      gtk_label_set_text (GTK_LABEL (display->id_label), info->id);

      if (info->item.label)
        {
          str = g_strdup_printf ("%s %s", info->item.label, info->accel_str);
          gtk_label_set_text_with_mnemonic (GTK_LABEL (display->label_accel_label), str);
          g_free (str);
        }
      else
        {
          gtk_label_set_text (GTK_LABEL (display->label_accel_label), "");
        }

      if (info->small_icon)
        gtk_image_set_from_stock (GTK_IMAGE (display->icon_image), info->id,
                                  get_largest_size (info->id));
      else
        gtk_image_set_from_pixbuf (GTK_IMAGE (display->icon_image), NULL);

      stock_item_info_free (info);
    }
  else
    {
      gtk_label_set_text (GTK_LABEL (display->type_label), "No selected item");
      gtk_label_set_text (GTK_LABEL (display->macro_label), "");
      gtk_label_set_text (GTK_LABEL (display->id_label), "");
      gtk_label_set_text (GTK_LABEL (display->label_accel_label), "");
      gtk_image_set_from_pixbuf (GTK_IMAGE (display->icon_image), NULL);
    }
}
Exemplo n.º 22
0
// Works only for buttons created with CreateButton()
void SetButtonStock(GtkWidget *button, const gchar *image)
{
    GtkWidget *alignment = gtk_bin_get_child(GTK_BIN(button));
    GtkWidget *hbox = gtk_bin_get_child(GTK_BIN(alignment));
    CPointerWrapper<GList> list(gtk_container_get_children(GTK_CONTAINER(hbox)), g_list_free);
    GtkWidget *img = GTK_WIDGET(list->data);
    gtk_image_set_from_stock(GTK_IMAGE(img), image, GTK_ICON_SIZE_BUTTON);
}
Exemplo n.º 23
0
void linphone_gtk_in_call_view_set_paused(LinphoneCall *call){
	GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
	GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
	GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
	gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
	gtk_label_set_markup(GTK_LABEL(status),_("<b>Paused call</b>"));
	gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_MEDIA_PAUSE,GTK_ICON_SIZE_DIALOG);
}
Exemplo n.º 24
0
static void
nsp_window_cmd_webview_expand (GtkToggleButton *button, NspWindow *win)
{
	if ( gtk_toggle_button_get_active(button) ) {
		gtk_image_set_from_stock(GTK_IMAGE(gtk_builder_get_object(win->builder, "feed_item_fullscreen_image")), 
									GTK_STOCK_LEAVE_FULLSCREEN, GTK_ICON_SIZE_BUTTON);
		gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(win->builder, "vbox_left_panel")));
		gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(win->builder, "hbox_right_panel_header")));
		gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(win->builder, "feed_item_list_win")));
	} else {
		gtk_image_set_from_stock(GTK_IMAGE(gtk_builder_get_object(win->builder, "feed_item_fullscreen_image")), 
									GTK_STOCK_FULLSCREEN, GTK_ICON_SIZE_BUTTON);
		gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(win->builder, "vbox_left_panel")));
		gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(win->builder, "hbox_right_panel_header")));
		gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(win->builder, "feed_item_list_win")));
	}
}
Exemplo n.º 25
0
/**
 * gdaui_set_icon_from_stock
 * @bar: a #GdauiBar widget.
 * @stock_id: a stock icon name.
 * @size: a tock icon size.
 *
 * Set the icon using a stock icon for the given gray bar.
 */
void
gdaui_bar_set_icon_from_stock (GdauiBar *bar, const gchar *stock_id, GtkIconSize size)
{
        g_return_if_fail (GDAUI_IS_BAR (bar));

        gtk_image_set_from_stock (GTK_IMAGE (bar->priv->icon), stock_id, size);
        gdaui_bar_set_show_icon (bar, TRUE);
}
Exemplo n.º 26
0
// Setzt auf dem Play Button auf Play oder Pause
void interface_set_playimage(const gchar *stock_id)
{
	GtkImage *playimage = NULL;

	playimage = GTK_IMAGE( interface_get_widget ("image_play"));
	if (playimage != NULL) {
		gtk_image_set_from_stock(playimage, stock_id, GTK_ICON_SIZE_BUTTON);
	}
}
static GnomeKeyringOperationGetIntCallback
stored_password (GnomeKeyringResult res, guint32 val, widgets *data)
{
    /* user_data will be the same as was passed to gnome_keyring_store_password() */

    if (res != GNOME_KEYRING_RESULT_OK)
    {
        gtk_image_set_from_stock(GTK_IMAGE(data->image_credentials), "gtk-stop", GTK_ICON_SIZE_BUTTON);
        gtk_label_set_label(GTK_LABEL(data->label_credentials), gnome_keyring_result_to_message (res));
    }
}
void
gedit_progress_message_area_set_stock_image (GeditProgressMessageArea *area,
					     const gchar              *stock_id)
{
	g_return_if_fail (GEDIT_IS_PROGRESS_MESSAGE_AREA (area));
	g_return_if_fail (stock_id != NULL);
	
	gtk_image_set_from_stock (GTK_IMAGE (area->priv->image),
				  stock_id,
				  GTK_ICON_SIZE_SMALL_TOOLBAR);
}
static void
update_preview (GtkFileChooser               *chooser,
                GnomeDesktopThumbnailFactory *thumb_factory)
{
        gchar *uri;

        uri = gtk_file_chooser_get_preview_uri (chooser);

        if (uri) {
                GdkPixbuf *pixbuf = NULL;
                const gchar *mime_type = NULL;
                GFile *file;
                GFileInfo *file_info;
                GtkWidget *preview;

                preview = gtk_file_chooser_get_preview_widget (chooser);

                file = g_file_new_for_uri (uri);
                file_info = g_file_query_info (file,
                                               G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
                                               G_FILE_QUERY_INFO_NONE,
                                               NULL, NULL);
                g_object_unref (file);

                if (file_info != NULL) {
                        mime_type = g_file_info_get_content_type (file_info);
                        g_object_unref (file_info);
                }

                if (mime_type) {
                        pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (thumb_factory,
                                                                                     uri,
                                                                                     mime_type);
                }

                gtk_dialog_set_response_sensitive (GTK_DIALOG (chooser),
                                                   GTK_RESPONSE_ACCEPT,
                                                   (pixbuf != NULL));

                if (pixbuf != NULL) {
                        gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
                        g_object_unref (pixbuf);
                }
                else {
                        gtk_image_set_from_stock (GTK_IMAGE (preview),
                                                  GTK_STOCK_DIALOG_QUESTION,
                                                  GTK_ICON_SIZE_DIALOG);
                }

                g_free (uri);
        }

        gtk_file_chooser_set_preview_widget_active (chooser, TRUE);
}
static gboolean
test_maybe_timeout (struct test_data_t *data)
{
	double_click_state = DOUBLE_CLICK_TEST_OFF;

	gtk_image_set_from_stock (GTK_IMAGE (data->image),
				  MOUSE_DBLCLCK_OFF, mouse_capplet_dblclck_icon_get_size());

	*data->timeout_id = 0;

	return FALSE;
}