diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-11-22 18:41:30 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-11-22 20:55:03 +0900 |
commit | 5bed6e4a4c916a97f8fe4d1b07f7eecf4d733b90 (patch) | |
tree | f89cc49efc9ca1d0e1579ecb079ee7e7088ff8c8 /src/libs/dialogs/deletedialog.h | |
parent | 0bfbf616d9c1fd7abb1bd02732389ab35e5f8771 (diff) | |
download | digikam-5bed6e4a4c916a97f8fe4d1b07f7eecf4d733b90.tar.gz digikam-5bed6e4a4c916a97f8fe4d1b07f7eecf4d733b90.zip |
Rename 'digikam' folder to 'src'
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit ee0d99607c14cb63d3ebdb3a970b508949fa8219)
Diffstat (limited to 'src/libs/dialogs/deletedialog.h')
-rw-r--r-- | src/libs/dialogs/deletedialog.h | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/src/libs/dialogs/deletedialog.h b/src/libs/dialogs/deletedialog.h new file mode 100644 index 00000000..16ab9f89 --- /dev/null +++ b/src/libs/dialogs/deletedialog.h @@ -0,0 +1,140 @@ +/* ============================================================ + * + * This file is a part of digiKam project + * http://www.digikam.org + * + * Date : 2005-05-07 + * Description : a dialog to delete item. + * + * Copyright (C) 2004 by Michael Pyne <michael.pyne@kdemail.net> + * Copyright (C) 2006 by Ian Monroe <ian@monroe.nu> + * Copyright (C) 2006-2007 by Marcel Wiesweg <marcel.wiesweg@gmx.de> + * + * 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, 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. + * + * ============================================================ */ + +#ifndef _DELETEDIALOG_H +#define _DELETEDIALOG_H + +// TQt includes. + +#include <tqcheckbox.h> + +// KDE includes. + +#include <kdialogbase.h> +#include <kurl.h> + +// Local includes. + +#include "digikam_export.h" +#include "deletedialogbase.h" + +class TQStringList; +class TDEListBox; +class KGuiItem; +class TQLabel; +class TQWidgetStack; + +namespace Digikam +{ + +namespace DeleteDialogMode +{ + enum ListMode + { + Files, + Albums, + Subalbums + }; + + enum DeleteMode + { + NoChoiceTrash, // "Do not show again" checkbox, does not show if config entry is set + NoChoiceDeletePermanently, // No checkbox + UserPreference, // Checkbox to toggle trash/permanent, preset to user's last preference + UseTrash, // same beckbox as above, preset to trash + DeletePermanently // same checkbox as above, preset to permanent + }; +} + +class DeleteWidget : public DeleteDialogBase +{ + TQ_OBJECT + + +public: + + DeleteWidget(TQWidget *parent = 0, const char *name = 0); + + void setFiles(const KURL::List &files); + void setListMode(DeleteDialogMode::ListMode mode); + void setDeleteMode(DeleteDialogMode::DeleteMode deleteMode); + +protected slots: + + void slotShouldDelete(bool shouldDelete); + +protected: + + void updateText(); + DeleteDialogMode::ListMode m_listMode; + DeleteDialogMode::DeleteMode m_deleteMode; +}; + +class DIGIKAM_EXPORT DeleteDialog : public KDialogBase +{ + TQ_OBJECT + + +public: + + enum Mode + { + ModeFiles, + ModeAlbums, + ModeSubalbums + }; + +public: + + DeleteDialog(TQWidget *parent, const char *name = "delete_dialog"); + + bool confirmDeleteList(const KURL::List &condemnedURLs, + DeleteDialogMode::ListMode listMode, + DeleteDialogMode::DeleteMode deleteMode); + bool shouldDelete() const { return m_widget->ddShouldDelete->isChecked(); } + + void setURLs(const KURL::List &files); + void presetDeleteMode(DeleteDialogMode::DeleteMode mode); + void setListMode(DeleteDialogMode::ListMode mode); + +protected slots: + + virtual void accept(); + void slotShouldDelete(bool shouldDelete); + +private: + + bool m_saveShouldDeleteUserPreference; + bool m_saveDoNotShowAgain; + + KGuiItem m_trashGuiItem; + + DeleteWidget *m_widget; +}; + +} // namespace Digikam + +#endif // _DELETEDIALOG_H + |