#include "modest-ui-dimming-rules.h"
#include "modest-dimming-rule.h"
#include "modest-tny-folder.h"
+#include "modest-tny-account.h"
#include "modest-text-utils.h"
#include <widgets/modest-attachments-view.h>
#include <modest-runtime.h>
modest_ui_dimming_rules_on_rename_folder (ModestWindow *win, gpointer user_data)
{
ModestDimmingRule *rule = NULL;
- TnyFolderType types[3];
+ TnyFolderType types[4];
gboolean dimmed = FALSE;
g_return_val_if_fail (MODEST_IS_MAIN_WINDOW(win), FALSE);
types[0] = TNY_FOLDER_TYPE_DRAFTS;
types[1] = TNY_FOLDER_TYPE_OUTBOX;
types[2] = TNY_FOLDER_TYPE_SENT;
+ types[3] = TNY_FOLDER_TYPE_ARCHIVE;
/* Check dimmed rule */
if (!dimmed) {
modest_dimming_rule_set_notification (rule, "");
}
if (!dimmed) {
- dimmed = _selected_folder_is_any_of_type (win, types, 3);
+ dimmed = _selected_folder_is_any_of_type (win, types, 4);
if (dimmed)
modest_dimming_rule_set_notification (rule, "");
}
if (MODEST_IS_MAIN_WINDOW (win))
main_window = win;
- else {
+ else
main_window =
modest_window_mgr_get_main_window (modest_runtime_get_window_mgr ());
- }
-
+
+ /* TODO: Javi, what about if the main window does not
+ exist?. Adding some code to avoid CRITICALs */
+ if (!main_window)
+ return FALSE;
/* Get header view to check selected messages */
header_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(main_window),