Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
evolution
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
178
Issues
178
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
evolution
Commits
e2bf5a17
Commit
e2bf5a17
authored
Jul 02, 2009
by
Chenthill Palanisamy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the start_in_offline state only when the user chooses to go
offline and not when network goes offline.
parent
afea6478
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
8 deletions
+39
-8
shell/e-shell-nm.c
shell/e-shell-nm.c
+30
-0
shell/e-shell.c
shell/e-shell.c
+9
-8
No files found.
shell/e-shell-nm.c
View file @
e2bf5a17
...
...
@@ -102,6 +102,34 @@ e_shell_network_monitor (DBusConnection *connection G_GNUC_UNUSED,
return
DBUS_HANDLER_RESULT_HANDLED
;
}
static
void
check_initial_state
(
EShell
*
shell
)
{
DBusMessage
*
message
=
NULL
,
*
response
=
NULL
;
guint32
state
=
-
1
;
DBusError
error
=
DBUS_ERROR_INIT
;
message
=
dbus_message_new_method_call
(
NM_DBUS_SERVICE
,
NM_DBUS_PATH
,
NM_DBUS_INTERFACE
,
"state"
);
/* assuming this should be safe to call syncronously */
response
=
dbus_connection_send_with_reply_and_block
(
dbus_connection
,
message
,
100
,
&
error
);
if
(
response
)
dbus_message_get_args
(
response
,
&
error
,
DBUS_TYPE_UINT32
,
&
state
,
DBUS_TYPE_INVALID
);
else
{
g_warning
(
"%s
\n
"
,
error
.
message
);
dbus_error_free
(
&
error
);
return
;
}
/* update the state only in the absence of network connection else let the old state prevail */
if
(
state
==
NM_STATE_DISCONNECTED
)
e_shell_set_line_status
(
shell
,
GNOME_Evolution_FORCED_OFFLINE
);
dbus_message_unref
(
message
);
dbus_message_unref
(
response
);
}
gboolean
e_shell_dbus_initialise
(
EShell
*
shell
)
{
...
...
@@ -123,6 +151,8 @@ e_shell_dbus_initialise (EShell *shell)
if
(
!
dbus_connection_add_filter
(
dbus_connection
,
e_shell_network_monitor
,
shell
,
NULL
))
goto
exception
;
check_initial_state
(
shell
);
dbus_bus_add_match
(
dbus_connection
,
"type='signal',"
"interface='"
NM_DBUS_INTERFACE
"',"
...
...
shell/e-shell.c
View file @
e2bf5a17
...
...
@@ -1030,7 +1030,7 @@ e_shell_save_settings (EShell *shell)
GConfClient
*
client
;
gboolean
is_offline
;
is_offline
=
(
e_shell_get_line_status
(
shell
)
==
E_SHELL_LINE_STATUS_OFFLINE
||
e_shell_get_line_status
(
shell
)
==
E_SHELL_LINE_STATUS_FORCED_OFFLINE
);
is_offline
=
(
e_shell_get_line_status
(
shell
)
==
E_SHELL_LINE_STATUS_OFFLINE
);
client
=
gconf_client_get_default
();
gconf_client_set_bool
(
client
,
"/apps/evolution/shell/start_offline"
,
is_offline
,
NULL
);
...
...
@@ -1132,20 +1132,20 @@ e_shell_set_line_status (EShell *shell,
GSList
*
p
;
CORBA_Environment
ev
;
GConfClient
*
client
;
gboolean
status
;
gboolean
is_online
;
gboolean
forced
=
FALSE
;
priv
=
shell
->
priv
;
if
(
shell_state
==
GNOME_Evolution_FORCED_OFFLINE
||
shell_state
==
GNOME_Evolution_USER_OFFLINE
)
{
status
=
FALSE
;
is_online
=
FALSE
;
if
(
shell_state
==
GNOME_Evolution_FORCED_OFFLINE
)
forced
=
TRUE
;
}
else
status
=
TRUE
;
is_online
=
TRUE
;
if
((
status
&&
priv
->
line_status
==
E_SHELL_LINE_STATUS_ONLINE
)
||
(
!
status
&&
priv
->
line_status
==
E_SHELL_LINE_STATUS_OFFLINE
&&
!
forced
))
if
((
is_online
&&
priv
->
line_status
==
E_SHELL_LINE_STATUS_ONLINE
)
||
(
!
is_online
&&
priv
->
line_status
==
E_SHELL_LINE_STATUS_OFFLINE
&&
!
forced
))
return
;
/* we use 'going offline' to mean 'changing status' now */
...
...
@@ -1153,10 +1153,11 @@ e_shell_set_line_status (EShell *shell,
g_signal_emit
(
shell
,
signals
[
LINE_STATUS_CHANGED
],
0
,
priv
->
line_status
);
client
=
gconf_client_get_default
();
gconf_client_set_bool
(
client
,
"/apps/evolution/shell/start_offline"
,
!
status
,
NULL
);
if
(
!
forced
)
gconf_client_set_bool
(
client
,
"/apps/evolution/shell/start_offline"
,
!
is_online
,
NULL
);
g_object_unref
(
client
);
priv
->
line_status_working
=
status
?
E_SHELL_LINE_STATUS_ONLINE
:
forced
?
E_SHELL_LINE_STATUS_FORCED_OFFLINE
:
E_SHELL_LINE_STATUS_OFFLINE
;
priv
->
line_status_working
=
is_online
?
E_SHELL_LINE_STATUS_ONLINE
:
forced
?
E_SHELL_LINE_STATUS_FORCED_OFFLINE
:
E_SHELL_LINE_STATUS_OFFLINE
;
/* we start at 2: setLineStatus could recursively call back, we therefore
`need to not complete till we're really complete */
priv
->
line_status_pending
+=
2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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