KIO
renamedialog.cpp
63 const QString text = hasDate ? i18n("Date: %1", item.timeString(KFileItem::ModificationTime)) : QString();
166 // sets the text in file name line edit box, selecting the filename (but not the extension if there is one).
227 d->bApplyAll->setToolTip((_options & RenameDialog_DestIsDirectory) ? i18n("When this is checked the button pressed will be applied to all "
240 connect(d->bSuggestNewName, &QAbstractButton::clicked, this, &RenameDialog::suggestNewNamePressed);
246 d->bSkip->setToolTip((_options & RenameDialog_DestIsDirectory) ? i18n("Do not copy or move this folder, skip to the next item instead")
261 i18n("Files and folders will be copied into the existing directory, alongside its existing contents.\nYou will be prompted again in case of a "
264 } else if ((_options & RenameDialog_MultipleItems) && mtimeSrc.isValid() && mtimeDest.isValid()) {
265 d->bOverwriteWhenOlder = new QAction(QIcon::fromTheme(KStandardGuiItem::overwrite().iconName()),
266 i18nc("Overwrite files into an existing folder when files are older", "&Overwrite older files"),
270 i18n("Destination files which have older modification times will be overwritten by the source, skipped otherwise."));
271 connect(d->bOverwriteWhenOlder, &QAction::triggered, this, &RenameDialog::overwriteWhenOlderPressed);
359 connect(d->m_srcArea->verticalScrollBar(), &QAbstractSlider::valueChanged, d->m_destArea->verticalScrollBar(), &QAbstractSlider::setValue);
360 connect(d->m_destArea->verticalScrollBar(), &QAbstractSlider::valueChanged, d->m_srcArea->verticalScrollBar(), &QAbstractSlider::setValue);
361 connect(d->m_srcArea->horizontalScrollBar(), &QAbstractSlider::valueChanged, d->m_destArea->horizontalScrollBar(), &QAbstractSlider::setValue);
362 connect(d->m_destArea->horizontalScrollBar(), &QAbstractSlider::valueChanged, d->m_srcArea->horizontalScrollBar(), &QAbstractSlider::setValue);
382 QLabel *destUrlLabel = createSqueezedLabel(this, d->dest.toDisplayString(QUrl::PreferLocalFile));
390 const QString arrowName = qApp->isRightToLeft() ? QStringLiteral("go-previous") : QStringLiteral("go-next");
404 gridLayout->addWidget(createLabel(this, QStringLiteral("The destination is <b>more recent</b>")), gridRow, 1);
406 QLabel *destDateLabel = createLabel(this, i18n("Date: %1", d->destItem.timeString(KFileItem::ModificationTime)));
412 if (d->srcItem.entry().contains(KIO::UDSEntry::UDS_SIZE) && d->destItem.entry().contains(KIO::UDSEntry::UDS_SIZE)
425 QLabel *destSizeLabel = createLabel(this, i18n("Size: %1", KIO::convertSize(d->destItem.size())));
429 if ((d->dest.isLocalFile() && !(_options & RenameDialog_DestIsDirectory)) && (d->src.isLocalFile() && !(_options & RenameDialog_SourceIsDirectory))) {
430 const CompareFilesResult CompareFilesResult = compareFiles(d->src.toLocalFile(), d->dest.toLocalFile());
449 i18n("The files are likely to be identical: they have the same size and their contents are the same at the beginning, middle and end."));
467 sentence1 = i18n("An older item named '%1' already exists.", d->dest.toDisplayString(QUrl::PreferLocalFile));
469 sentence1 = i18n("A similar file named '%1' already exists.", d->dest.toDisplayString(QUrl::PreferLocalFile));
471 sentence1 = i18n("A more recent item named '%1' already exists.", d->dest.toDisplayString(QUrl::PreferLocalFile));
717 const QPixmap pix = QIcon::fromTheme(fileitem.iconName(), QIcon::fromTheme(QStringLiteral("application-octet-stream"))).pixmap(size);
727 const QPixmap pix = QIcon::fromTheme(fileitem.iconName(), QIcon::fromTheme(QStringLiteral("application-octet-stream"))).pixmap(size);
759 parentWidget() ? parentWidget()->screen()->availableGeometry().size() : QGuiApplication::primaryScreen()->availableGeometry().size();
761 QSize halfSize = d->m_srcArea->widget()->sizeHint().expandedTo(d->m_destArea->widget()->sizeHint());
766 if (halfSize.height() > maxHalfSize.height() && halfSize.width() <= maxHalfSize.width() + d->m_srcArea->verticalScrollBar()->width()) {
774 KIO::PreviewJob *srcJob = KIO::filePreview(KFileItemList{d->srcItem}, QSize(d->m_srcPreview->width() * qreal(0.9), d->m_srcPreview->height()));
777 KIO::PreviewJob *destJob = KIO::filePreview(KFileItemList{d->destItem}, QSize(d->m_destPreview->width() * qreal(0.9), d->m_destPreview->height()));
786 QScrollArea *RenameDialog::createContainerLayout(QWidget *parent, const KFileItem &item, QLabel *preview)
794 // If we still want metadata shown, we need a plugin that fetches data from KFileMetaData::ExtractorCollection
799 // ### This is going to call resizePanels twice! Need to split it up to do preview job only once on each side
800 connect(metaWidget, SIGNAL(metaDataRequestFinished(KFileItemList)), this, SLOT(resizePanels()));
RenameDialog(QWidget *parent, const QString &title, const QUrl &src, const QUrl &dest, RenameDialog_Options options, KIO::filesize_t sizeSrc=KIO::filesize_t(-1), KIO::filesize_t sizeDest=KIO::filesize_t(-1), const QDateTime &ctimeSrc=QDateTime(), const QDateTime &ctimeDest=QDateTime(), const QDateTime &mtimeSrc=QDateTime(), const QDateTime &mtimeDest=QDateTime())
Construct a "rename" dialog to let the user know that src is about to overwrite dest.
Definition: renamedialog.cpp:200
PlainText
AlignHCenter
void setRowMinimumHeight(int row, int minSize)
QWidget(QWidget *parent, Qt::WindowFlags f)
KIOCORE_EXPORT QString convertSize(KIO::filesize_t size)
Converts size from bytes to the string representation.
Definition: global.cpp:43
availableGeometry
ReadOnly
primaryScreen
QLayout * layout() const const
void setTextFormat(Qt::TextFormat)
Definition: udsentry.h:77
Definition: kfileitem.h:657
void clicked(bool checked)
QIcon fromTheme(const QString &name)
@ Result_OverwriteWhenOlder
Can be returned only when multiple files are passed, Option overwrite is passed And files modificatio...
Definition: jobuidelegateextension.h:128
QScreen * screen() const const
int width() const const
void setFrameShape(QFrame::Shape)
KIOCORE_EXPORT QString encodeFileName(const QString &str)
Encodes (from the text displayed to the real filename) This translates '/' into a "unicode fraction s...
Definition: global.cpp:139
@ RenameDialog_SourceIsDirectory
The source is a directory, the dialog updates labels and tooltips accordingly.
Definition: jobuidelegateextension.h:40
void addStretch(int stretch)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString suffixForFileName(const QString &fileName) const const
void setScaleType(ScaleType type)
Sets the scale type for the generated preview.
Definition: previewjob.cpp:310
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
Q_INVOKABLE QString timeString(FileTimes which=ModificationTime) const
Requests the modification, access or creation time as a string, depending on which.
Definition: kfileitem.cpp:1447
void setValue(int)
KGuiItem cancel()
bool isValid() const const
static void assign(QPushButton *button, const KGuiItem &item)
QString i18n(const char *text, const TYPE &arg...)
KCOREADDONS_EXPORT QString csqueeze(const QString &str, int maxlen=40)
int height() const const
KIOCORE_EXPORT QString decodeFileName(const QString &str)
Decodes (from the filename to the text displayed) This doesn't do anything anymore,...
Definition: global.cpp:146
PreferLocalFile
void setTabOrder(QWidget *first, QWidget *second)
void setAlignment(Qt::Alignment)
void addLayout(QLayout *layout, int row, int column, Qt::Alignment alignment)
SizeEnormous
@ RenameDialog_DestIsDirectory
The destination is a directory, the dialog updates labels and tooltips accordingly.
Definition: jobuidelegateextension.h:39
void textChanged(const QString &text)
bool isEmpty() const const
WhatsThisCursor
int length() const const
void setWindowTitle(const QString &)
MenuButtonPopup
void reserve(int size)
Calling this function before inserting items into an empty UDSEntry may save time and memory.
Definition: udsentry.cpp:396
@ RenameDialog_Overwrite
We have an existing destination, show details about it and offer to overwrite it.
Definition: jobuidelegateextension.h:28
qint64 toMSecsSinceEpoch() const const
QSize boundedTo(const QSize &otherSize) const const
QueuedConnection
void setReadOnly(bool readOnly)
KCOREADDONS_EXPORT QString suggestName(const QUrl &baseURL, const QString &oldName)
Given a directory path and a filename (which usually exists already), this function returns a suggest...
Definition: global.cpp:280
virtual void done(int r)
@ RenameDialog_OverwriteItself
Warn that the current operation would overwrite a file with itself, which is not allowed.
Definition: jobuidelegateextension.h:29
QString errorString() const const
int & rwidth()
void failed(const KFileItem &item)
Emitted when a thumbnail for item could not be created, either because a ThumbCreator for its MIME ty...
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
void setMinimumHeight(int minh)
QString label(StandardShortcut id)
static QString suggestName(const QUrl &baseURL, const QString &oldName)
Given a directory path and a filename (which usually exists already), this function returns a suggest...
Definition: renamedialog.cpp:620
NoFrame
void setWidgetResizable(bool resizable)
void resize(int w, int h)
void fastInsert(uint field, const QString &value)
insert field with string value, it will assert if the field is already inserted.
Definition: udsentry.cpp:401
void triggered(bool checked)
QString path(QUrl::ComponentFormattingOptions options) const const
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) const const
void setToolTip(const QString &)
@ UDS_MODIFICATION_TIME
The last time the file was modified. Required time format: seconds since UNIX epoch.
Definition: udsentry.h:259
void setSpacing(int spacing)
void setObjectName(const QString &name)
Definition: renamedialog.h:39
void setPath(const QString &path, QUrl::ParsingMode mode)
void addWidget(QWidget *w)
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
bool isValid() const const
void setContentsMargins(int left, int top, int right, int bottom)
void valueChanged(int value)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
bool isRightToLeft() const const
ToolButtonTextBesideIcon
void setItems(const KFileItemList &items)
void addWidget(QWidget *widget, int row, int column, Qt::Alignment alignment)
void gotPreview(const KFileItem &item, const QPixmap &preview)
Emitted when a thumbnail picture for item has been successfully retrieved.
@ RenameDialog_MultipleItems
Set if the current operation concerns multiple files, so it makes sense to offer buttons that apply t...
Definition: jobuidelegateextension.h:31
void addLayout(QLayout *layout, int stretch)
void setBold(bool enable)
void addSpacing(int size)
MinimumExpanding
void setPixmap(const QPixmap &)
Definition: kfileitem.h:35
KGuiItem overwrite()
size
QWidget * parentWidget() const const
@ RenameDialog_Skip
Offer a "Skip" button, to skip other files too. Requires RenameDialog_MultipleItems.
Definition: jobuidelegateextension.h:30
void addStrut(int size)
QObject * parent() const const
KIOWIDGETS_EXPORT PreviewJob * filePreview(const KFileItemList &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const QStringList *enabledPlugins=nullptr)
Creates a PreviewJob to generate or retrieve a preview image for the given URL.
Definition: previewjob.cpp:1055
void setWidget(QWidget *widget)
@ RenameDialog_Resume
Offer a "Resume" button (plus "Resume All" if RenameDialog_MultipleItems).
Definition: jobuidelegateextension.h:33
void setCursor(const QCursor &)
virtual QSize sizeHint() const const override
@ UDS_CREATION_TIME
The time the file was created. Required time format: seconds since UNIX epoch.
Definition: udsentry.h:263
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:54:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:54:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.