[goobox] removed the volume button
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goobox] removed the volume button
- Date: Wed, 5 Dec 2012 16:22:38 +0000 (UTC)
commit fe3a7538fbbb83148ed2b4ac28ada8a4e12ae064
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Dec 4 16:21:26 2012 +0100
removed the volume button
the user can use the system volume controller to change the
volume.
src/Makefile.am | 2 -
src/goo-volume-tool-button.c | 810 ------------------------------------------
src/goo-volume-tool-button.h | 87 -----
src/goo-window.c | 64 ----
src/goo-window.h | 3 -
src/main.c | 22 --
6 files changed, 0 insertions(+), 988 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index eea5784..861716c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -59,8 +59,6 @@ goobox_SOURCES = \
goo-player-info.h \
goo-stock.c \
goo-stock.h \
- goo-volume-tool-button.c \
- goo-volume-tool-button.h \
goo-window.c \
goo-window.h \
gth-toggle-menu-action.c \
diff --git a/src/goo-window.c b/src/goo-window.c
index 35e6fea..0407dbb 100644
--- a/src/goo-window.c
+++ b/src/goo-window.c
@@ -35,7 +35,6 @@
#include "goo-player.h"
#include "goo-player-info.h"
#include "goo-window.h"
-#include "goo-volume-tool-button.h"
#include "gth-toggle-menu-tool-button.h"
#include "gth-user-dir.h"
#include "gtk-utils.h"
@@ -57,7 +56,6 @@
#define FALLBACK_ICON_SIZE 16
#define CONFIG_KEY_AUTOFETCH_GROUP "AutoFetch"
#define ACTIONS_MENU_BUTTON_POSITION 6
-#define VOLUME_BUTTON_POSITION 8
#define TRAY_TOOLTIP_DELAY 500
#define AUTOPLAY_DELAY 250
#define MAX_WINDOW_HEIGHT_PERCENTAGE 0.80
@@ -81,7 +79,6 @@ struct _GooWindowPrivate {
GtkWidget *status_tooltip_content;
GtkWidget *info;
- GtkWidget *volume_button;
guint help_message_cid;
guint list_info_cid;
@@ -2015,14 +2012,6 @@ status_icon_popup_menu_cb (GtkStatusIcon *status_icon,
static void
-volume_button_changed_cb (GooVolumeToolButton *button,
- GooWindow *window)
-{
- goo_player_set_audio_volume (window->priv->player, goo_volume_tool_button_get_volume (button));
-}
-
-
-static void
goo_window_init (GooWindow *window)
{
window->priv = GOO_WINDOW_GET_PRIVATE_DATA (window);
@@ -2350,31 +2339,6 @@ goo_window_construct (GooWindow *window,
ACTIONS_MENU_BUTTON_POSITION + 1);
}
- /* Add the volume button to the toolbar. */
-
- {
- GtkToolItem *sep;
-
- sep = gtk_separator_tool_item_new ();
- gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (sep), FALSE);
- gtk_tool_item_set_expand (GTK_TOOL_ITEM (sep), TRUE);
- gtk_widget_show (GTK_WIDGET (sep));
- gtk_toolbar_insert (GTK_TOOLBAR (window->priv->toolbar),
- GTK_TOOL_ITEM (sep),
- VOLUME_BUTTON_POSITION);
- }
-
- window->priv->volume_button = (GtkWidget*) goo_volume_tool_button_new ();
- g_signal_connect (window->priv->volume_button,
- "changed",
- G_CALLBACK (volume_button_changed_cb),
- window);
- gtk_widget_show (GTK_WIDGET (window->priv->volume_button));
- gtk_tool_item_set_is_important (GTK_TOOL_ITEM (window->priv->volume_button), FALSE);
- gtk_toolbar_insert (GTK_TOOLBAR (window->priv->toolbar),
- GTK_TOOL_ITEM (window->priv->volume_button),
- VOLUME_BUTTON_POSITION + 1);
-
/**/
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
@@ -2424,10 +2388,6 @@ goo_window_construct (GooWindow *window,
g_settings_get_int (window->priv->settings_ui, PREF_UI_WINDOW_WIDTH),
g_settings_get_int (window->priv->settings_ui, PREF_UI_WINDOW_HEIGHT));
- goo_volume_tool_button_set_volume (GOO_VOLUME_TOOL_BUTTON (window->priv->volume_button),
- g_settings_get_int (window->priv->settings_general, PREF_GENERAL_VOLUME) / 100.0,
- TRUE);
-
/* The status icon. */
if (! notification_has_persistence ()) {
@@ -3024,30 +2984,6 @@ goo_window_toggle_visibility (GooWindow *window)
}
-double
-goo_window_get_volume (GooWindow *window)
-{
- GooVolumeToolButton *volume_button;
-
- volume_button = GOO_VOLUME_TOOL_BUTTON (window->priv->volume_button);
- return goo_volume_tool_button_get_volume (volume_button);
-}
-
-
-void
-goo_window_set_volume (GooWindow *window,
- double value)
-{
- GooVolumeToolButton *volume_button;
-
- if (window->priv->hibernate)
- return;
-
- volume_button = GOO_VOLUME_TOOL_BUTTON (window->priv->volume_button);
- goo_volume_tool_button_set_volume (volume_button, value, TRUE);
-}
-
-
void
goo_window_set_hibernate (GooWindow *window,
gboolean hibernate)
diff --git a/src/goo-window.h b/src/goo-window.h
index a5d0ad7..013e190 100644
--- a/src/goo-window.h
+++ b/src/goo-window.h
@@ -89,9 +89,6 @@ void goo_window_pick_cover_from_disk (GooWindow *window);
void goo_window_search_cover_on_internet (GooWindow *window);
void goo_window_remove_cover (GooWindow *window);
void goo_window_toggle_visibility (GooWindow *window);
-double goo_window_get_volume (GooWindow *window);
-void goo_window_set_volume (GooWindow *window,
- double value);
void goo_window_set_hibernate (GooWindow *window,
gboolean hibernate);
void goo_window_set_current_cd_autofetch (GooWindow *window,
diff --git a/src/main.c b/src/main.c
index 5392aa6..9faa26a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -60,8 +60,6 @@ static int arg_stop = FALSE;
static int arg_next = FALSE;
static int arg_prev = FALSE;
static int arg_eject = FALSE;
-static int arg_volume_up = FALSE;
-static int arg_volume_down = FALSE;
static int arg_quit = FALSE;
static gboolean arg_version = FALSE;
static char *arg_device = NULL;
@@ -93,12 +91,6 @@ static const GOptionEntry options[] = {
{ "toggle-visibility", '\0', 0, G_OPTION_ARG_NONE, &arg_toggle_visibility,
N_("Toggle the main window visibility"),
0 },
- { "volume-up", '\0', 0, G_OPTION_ARG_NONE, &arg_volume_up,
- N_("Volume Up"),
- 0 },
- { "volume-down", '\0', 0, G_OPTION_ARG_NONE, &arg_volume_down,
- N_("Volume Down"),
- 0 },
{ "quit", '\0', 0, G_OPTION_ARG_NONE, &arg_quit,
N_("Quit the application"),
0 },
@@ -382,18 +374,6 @@ goo_application_command_line (GApplication *application,
else if (arg_toggle_visibility) {
goo_window_toggle_visibility (GOO_WINDOW (window));
}
- else if (arg_volume_up) {
- double volume;
-
- volume = goo_window_get_volume (GOO_WINDOW (window));
- goo_window_set_volume (GOO_WINDOW (window), volume + VOLUME_STEP);
- }
- else if (arg_volume_down) {
- double volume;
-
- volume = goo_window_get_volume (GOO_WINDOW (window));
- goo_window_set_volume (GOO_WINDOW (window), volume - VOLUME_STEP);
- }
else if (arg_quit) {
goo_window_close (GOO_WINDOW (window));
}
@@ -424,8 +404,6 @@ goo_application_command_line (GApplication *application,
arg_prev = FALSE;
arg_eject = FALSE;
arg_toggle_visibility = FALSE;
- arg_volume_up = FALSE;
- arg_volume_down = FALSE;
arg_quit = FALSE;
g_free (arg_device);
arg_device = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]