use tristate to change online mode
authorColin Leroy <colin@colino.net>
Wed, 16 Oct 2002 14:01:44 +0000 (14:01 +0000)
committerColin Leroy <colin@colino.net>
Wed, 16 Oct 2002 14:01:44 +0000 (14:01 +0000)
ChangeLog.claws
configure.in
src/main.c

index 531e7ae970695d1d710711546a4cb1b90e917d98..f8353385a8a2eb1e52d551d608063724e5161326 100644 (file)
@@ -1,9 +1,14 @@
+2002-10-16 [colin]     0.8.5claws41
+
+       * src/main.c
+               Use a tristate to change online mode
+
 2002-10-16 [paul]      0.8.5claws40
 
        * po/es.po
                updated by Ricardo Mones Lastra
 
-2002-10-15 [colin]     0.8.5claws39
+2002-10-16 [colin]     0.8.5claws39
 
        * src/main.c
          src/mainwindow.[ch]
index 17d141d3f543231400783907f5c1316c2b04b430..c0fd9e61288d844040fe3e831d635704422b41c4 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws40
+EXTRA_VERSION=claws41
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index c17a3dc6e81ff7a440c0508d4c46b11bd89fef05..c3abca9ca94be8c6f4bfe1b9e9d5ef6207afee39 100644 (file)
@@ -94,6 +94,14 @@ gboolean debug_mode = FALSE;
 static gint lock_socket = -1;
 static gint lock_socket_tag = 0;
 
+typedef enum 
+{
+       ONLINE_MODE_DONT_CHANGE,
+       ONLINE_MODE_ONLINE,
+       ONLINE_MODE_OFFLINE
+} OnlineMode;
+
+
 static struct Cmd {
        gboolean receive;
        gboolean receive_all;
@@ -103,8 +111,7 @@ static struct Cmd {
        gboolean status;
        gboolean send;
        gboolean crash;
-       gboolean online;
-       gboolean offline;
+       int online_mode;
        gchar   *crash_params;
 } cmd;
 
@@ -358,9 +365,9 @@ int main(int argc, char *argv[])
        if (cmd.send)
                send_queue();
 
-       if (cmd.offline)
+       if (cmd.online_mode == ONLINE_MODE_OFFLINE)
                main_window_toggle_work_offline(mainwin, TRUE);
-       if (cmd.online)
+       if (cmd.online_mode == ONLINE_MODE_ONLINE)
                main_window_toggle_work_offline(mainwin, FALSE);
        
        gtk_main();
@@ -422,9 +429,9 @@ static void parse_cmd_opt(int argc, char *argv[])
                } else if (!strncmp(argv[i], "--status", 8)) {
                        cmd.status = TRUE;
                } else if (!strncmp(argv[i], "--online", 8)) {
-                       cmd.online = TRUE;
+                       cmd.online_mode = ONLINE_MODE_ONLINE;
                } else if (!strncmp(argv[i], "--offline", 9)) {
-                       cmd.offline = TRUE;
+                       cmd.online_mode = ONLINE_MODE_OFFLINE;
                } else if (!strncmp(argv[i], "--help", 6)) {
                        g_print(_("Usage: %s [OPTION]...\n"),
                                g_basename(argv[0]));
@@ -666,9 +673,9 @@ static gint prohibit_duplicate_launch(void)
                g_free(compose_str);
        } else if (cmd.send) {
                fd_write(uxsock, "send\n", 5);
-       } else if (cmd.online) {
+       } else if (cmd.online_mode == ONLINE_MODE_ONLINE) {
                fd_write(uxsock, "online\n", 6);
-       } else if (cmd.offline) {
+       } else if (cmd.online_mode == ONLINE_MODE_OFFLINE) {
                fd_write(uxsock, "offline\n", 7);
        } else if (cmd.status) {
                gchar buf[BUFFSIZE];