Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
a1c6260d
Commit
a1c6260d
authored
Sep 20, 2007
by
Pierre-Luc Beaudoin
Browse files
Say hi to Mr. Status Icon!
parent
89264d66
Changes
5
Hide whitespace changes
Inline
Side-by-side
sflphone-gtk/src/Makefile.am
View file @
a1c6260d
...
...
@@ -14,13 +14,15 @@ sflphone_gtk_SOURCES = \
accountlist.c
\
accountwindow.c
\
marshaller.c
\
sliders.c
sliders.c
\
statusicon.c
noinst_HEADERS
=
actions.h dbus.h mainwindow.h calllist.h dialpad.h
\
callmanager-glue.h menus.h calltree.h screen.h configwindow.h
\
accountlist.h accountwindow.h marshaller.h sliders.h
accountlist.h accountwindow.h marshaller.h sliders.h
statusicon.h
EXTRA_DIST
=
marshaller.list
sflphone_gtk_LDADD
=
$(DEPS_LIBS)
AM_CPPFLAGS
=
$(DEPS_CFLAGS)
\
-DICONS_DIR
=
\"
"
$(datadir)
/sflphone"
\"
-DICONS_DIR
=
\"
"
$(datadir)
/sflphone"
\"
\
-DICON_DIR
=
\"
"
$(datadir)
/pixmaps"
\"
sflphone-gtk/src/main.c
View file @
a1c6260d
...
...
@@ -17,11 +17,12 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include
<
config
.h>
#include
<
actions
.h>
#include
<calllist.h>
#include
<config.h>
#include
<dbus.h>
#include
<mainwindow.h>
#include
<
acti
on
s
.h>
#include
<
statusic
on.h>
#include
<gtk/gtk.h>
#include
<stdlib.h>
...
...
@@ -41,6 +42,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\n");
if
(
sflphone_init
())
{
show_status_icon
();
create_main_window
();
/* start the main loop */
...
...
sflphone-gtk/src/mainwindow.c
View file @
a1c6260d
...
...
@@ -116,7 +116,7 @@ create_main_window ()
gtk_container_set_border_width
(
GTK_CONTAINER
(
window
),
0
);
gtk_window_set_title
(
GTK_WINDOW
(
window
),
PACKAGE
);
gtk_window_set_default_size
(
GTK_WINDOW
(
window
),
200
,
300
);
gtk_window_set_default_icon_from_file
(
ICON
S
_DIR
"/sflphone.png"
,
gtk_window_set_default_icon_from_file
(
ICON_DIR
"/sflphone.png"
,
NULL
);
/* Connect the destroy event of the window with our on_destroy function
...
...
sflphone-gtk/src/statusicon.c
0 → 100644
View file @
a1c6260d
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include
<gtk/gtk.h>
#include
<actions.h>
#include
<mainwindow.h>
#include
<statusicon.h>
GtkStatusIcon
*
status
;
gboolean
minimized
=
FALSE
;
void
status_quit
(
void
*
foo
)
{
sflphone_quit
();
}
void
activate
(
GtkStatusIcon
*
status_icon
,
void
*
foo
)
{
if
(
minimized
)
{
gtk_widget_show
(
GTK_WIDGET
(
get_main_window
()));
}
else
{
gtk_widget_hide
(
GTK_WIDGET
(
get_main_window
()));
}
minimized
=
!
minimized
;
}
void
menu
(
GtkStatusIcon
*
status_icon
,
guint
button
,
guint
activate_time
,
GtkWidget
*
menu
)
{
gtk_menu_popup
(
GTK_MENU
(
menu
),
NULL
,
NULL
,
NULL
,
NULL
,
button
,
activate_time
);
}
GtkWidget
*
create_menu
()
{
GtkWidget
*
menu
;
GtkWidget
*
menu_items
;
menu
=
gtk_menu_new
();
menu_items
=
gtk_image_menu_item_new_from_stock
(
GTK_STOCK_QUIT
,
get_accel_group
());
g_signal_connect_swapped
(
G_OBJECT
(
menu_items
),
"activate"
,
G_CALLBACK
(
status_quit
),
NULL
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
menu
),
menu_items
);
gtk_widget_show
(
menu_items
);
return
menu
;
}
void
show_status_icon
()
{
status
=
gtk_status_icon_new_from_file
(
ICON_DIR
"/sflphone.png"
);
g_signal_connect
(
G_OBJECT
(
status
),
"activate"
,
G_CALLBACK
(
activate
),
NULL
);
g_signal_connect
(
G_OBJECT
(
status
),
"popup-menu"
,
G_CALLBACK
(
menu
),
create_menu
());
}
sflphone-gtk/src/statusicon.h
0 → 100644
View file @
a1c6260d
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __STATUSICON_H__
#define __STATUSICON_H__
#include
<gtk/gtk.h>
/** @file statusicon.h
* @brief The status icon.
*/
void
show_status_icon
();
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment