removed "filtering setting" menu option and add a "cancel a news message" menu option
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Mon, 26 Aug 2002 22:53:35 +0000 (22:53 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Mon, 26 Aug 2002 22:53:35 +0000 (22:53 +0000)
ChangeLog.claws
configure.in
src/mainwindow.c
src/mainwindow.h
src/summaryview.c
src/summaryview.h

index 98d5d01..bc3f4f7 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-27 [hoa]       0.8.1claws123
+
+       * src/mainwindow.[ch]
+       * src/summaryview.[ch]
+               removed the "filter setting" menu option.
+               add a "cancel a news message" menu option.
+
 2002-08-26 [martin]    0.8.1claws122
 
        * ChangeLog.claws
                o add "Set default" button
                o align label and text + combo widgets
 
-2002-08-20 [hoa]       0.8.1claws84
+2002-08-20 [hoa]       0.8.1claws83bis
 
        * src/imap.c
                fixed a bug in imap_fetch_msginfo() in case there is no
index 151b7a3..7904347 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws122
+EXTRA_VERSION=claws123
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index ad93951..0e5df32 100644 (file)
@@ -223,6 +223,10 @@ static void delete_cb                      (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
 
+static void cancel_cb                   (MainWindow     *mainwin,
+                                        guint           action,
+                                        GtkWidget      *widget);
+
 static void mark_cb                    (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
@@ -610,6 +614,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Message/M_ove..."),              "<control>O", move_to_cb, 0, NULL},
        {N_("/_Message/_Copy..."),              "<shift><control>O", copy_to_cb, 0, NULL},
        {N_("/_Message/_Delete"),               "<control>D", delete_cb,  0, NULL},
+       {N_("/_Message/Cancel a news message"), "", cancel_cb,  0, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/_Mark"),                 NULL, NULL, 0, "<Branch>"},
        {N_("/_Message/_Mark/_Mark"),           "<shift>asterisk", mark_cb, 0, NULL},
@@ -657,8 +662,10 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, prefs_common_open_cb, 0, NULL},
        {N_("/_Configuration/C_ustom toolbar..."),
                                                NULL, prefs_toolbar_cb, 0, NULL},
+#if 0
        {N_("/_Configuration/_Filter setting..."),
                                                NULL, prefs_filter_open_cb, 0, NULL},
+#endif
        {N_("/_Configuration/_Scoring..."),
                                                NULL, prefs_scoring_open_cb, 0, NULL},
        {N_("/_Configuration/_Filtering..."),
@@ -1435,6 +1442,8 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
        if (mainwin->summaryview->folder_item &&
            mainwin->summaryview->folder_item->folder->type == F_NEWS)
                state |= M_NEWS;
+       else
+               state |= M_NOT_NEWS;
        if (selection == SUMMARY_SELECTED_SINGLE &&
            (item &&
             (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
@@ -1519,7 +1528,8 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/Message/Re-edit"               , M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
                {"/Message/Move..."               , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
                {"/Message/Copy..."               , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
-               {"/Message/Delete"                , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
+               {"/Message/Delete"                , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NOT_NEWS},
+               {"/Message/Cancel a news message" , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED|M_NEWS},
                {"/Message/Mark"                  , M_TARGET_EXIST},
 
                {"/Tools/Selective download..."     , M_HAVE_ACCOUNT|M_UNLOCKED},
@@ -2335,6 +2345,11 @@ static void delete_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
        summary_delete(mainwin->summaryview);
 }
 
+static void cancel_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
+{
+       summary_cancel(mainwin->summaryview);
+}
+
 static void open_msg_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 {
        summary_open_msg(mainwin->summaryview);
index 271b2d8..9044bdf 100644 (file)
@@ -47,7 +47,8 @@ typedef enum
        M_NEWS                = 1 << 11,
        M_HAVE_NEWS_ACCOUNT   = 1 << 12,
        M_HIDE_READ_MSG       = 1 << 13,
-       M_DELAY_EXEC          = 1 << 14
+       M_DELAY_EXEC          = 1 << 14,
+       M_NOT_NEWS            = 1 << 15,
 } SensitiveCond;
 
 typedef enum
index 68d32a5..cab3fb0 100644 (file)
@@ -401,6 +401,7 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/M_ove..."),               NULL, summary_move_to,  0, NULL},
        {N_("/_Copy..."),               NULL, summary_copy_to,  0, NULL},
        {N_("/_Delete"),                NULL, summary_delete,   0, NULL},
+       {N_("/Cancel a news message"),  NULL, summary_cancel,   0, NULL},
        {N_("/E_xecute"),               NULL, summary_execute_cb,       0, NULL},
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/_Mark"),                  NULL, NULL,             0, "<Branch>"},
@@ -1135,7 +1136,9 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        else
                menu_set_sensitive(ifactory, "/Move...", FALSE);
 
+#if 0
        menu_set_sensitive(ifactory, "/Delete", TRUE);
+#endif
        menu_set_sensitive(ifactory, "/Select all", TRUE);
        menu_set_sensitive(ifactory, "/Copy...", TRUE);
        menu_set_sensitive(ifactory, "/Execute", TRUE);
@@ -1183,6 +1186,9 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        else
                sens = FALSE;
        menu_set_sensitive(ifactory, "/Follow-up and reply to", sens);
+       menu_set_sensitive(ifactory, "/Cancel a news message", sens);
+       menu_set_sensitive(ifactory, "/Delete", !sens);
+
        summary_lock(summaryview);
        menuitem = gtk_item_factory_get_widget(ifactory, "/View/All header");
        gtk_check_menu_item_set_active
@@ -2858,6 +2864,34 @@ static void summary_delete_row(SummaryView *summaryview, GtkCTreeNode *row)
                    msginfo->folder->path, msginfo->msgnum);
 }
 
+void summary_cancel(SummaryView *summaryview)
+{
+       MsgInfo * msginfo;
+       GtkCList *clist = GTK_CLIST(summaryview->ctree);
+
+       msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
+                                             summaryview->selected);
+       if (!msginfo) return;
+
+       if (!check_permission(summaryview, msginfo))
+               return;
+
+       news_cancel_article(summaryview->folder_item->folder, msginfo);
+       
+       if (summary_is_locked(summaryview)) return;
+
+       summary_lock(summaryview);
+
+       gtk_clist_freeze(clist);
+
+       summary_update_status(summaryview);
+       summary_status_show(summaryview);
+
+       gtk_clist_thaw(clist);
+
+       summary_unlock(summaryview);
+}
+
 void summary_delete(SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
index 3f93ba8..d603f45 100644 (file)
@@ -210,6 +210,8 @@ void summary_sort             (SummaryView          *summaryview,
 void summary_delete              (SummaryView          *summaryview);
 void summary_delete_duplicated   (SummaryView          *summaryview);
 
+void summary_cancel               (SummaryView          *summaryview);
+
 gboolean summary_execute         (SummaryView          *summaryview);
 
 void summary_attract_by_subject          (SummaryView          *summaryview);