fileIsSameDialog::fileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule) : QDialog(parent), ui(new Ui::fileIsSameDialog) { ui->setupUi(this); action=FileExists_Cancel; oldName=fileInfo.fileName(); destinationInfo=fileInfo; ui->lineEditNewName->setText(oldName); ui->lineEditNewName->setPlaceholderText(oldName); ui->label_content_size->setText(QString::number(fileInfo.size())); ui->label_content_modified->setText(fileInfo.lastModified().toString()); ui->label_content_file_name->setText(fileInfo.fileName()); updateRenameButton(); QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); if(maxTime<fileInfo.lastModified()) { ui->label_modified->setVisible(true); ui->label_content_modified->setVisible(true); ui->label_content_modified->setText(fileInfo.lastModified().toString()); } else { ui->label_modified->setVisible(false); ui->label_content_modified->setVisible(false); } this->firstRenamingRule=firstRenamingRule; this->otherRenamingRule=otherRenamingRule; }
void FileIsSameDialog::on_lineEditNewName_returnPressed() { updateRenameButton(); if(ui->Rename->isEnabled()) on_Rename_clicked(); else QMessageBox::warning(this,tr("Error"),tr("Try rename with using special characters")); }
FileIsSameDialog::FileIsSameDialog(QWidget *parent,QFileInfo fileInfo,QString firstRenamingRule,QString otherRenamingRule) : QDialog(parent), ui(new Ui::fileIsSameDialog) { Qt::WindowFlags flags = windowFlags(); #ifdef Q_OS_LINUX flags=flags & ~Qt::X11BypassWindowManagerHint; #endif flags=flags | Qt::WindowStaysOnTopHint; setWindowFlags(flags); ui->setupUi(this); action=FileExists_Cancel; oldName=TransferThread::resolvedName(fileInfo); destinationInfo=fileInfo; ui->lineEditNewName->setText(oldName); ui->lineEditNewName->setPlaceholderText(oldName); ui->label_content_size->setText(QString::number(fileInfo.size())); ui->label_content_modified->setText(fileInfo.lastModified().toString()); ui->label_content_file_name->setText(TransferThread::resolvedName(fileInfo)); QString folder=fileInfo.absolutePath(); if(folder.size()>80) folder=folder.mid(0,38)+"..."+folder.mid(folder.size()-38); ui->label_content_folder->setText(folder); updateRenameButton(); QDateTime maxTime(QDate(ULTRACOPIER_PLUGIN_MINIMALYEAR,1,1)); if(maxTime<fileInfo.lastModified()) { ui->label_modified->setVisible(true); ui->label_content_modified->setVisible(true); ui->label_content_modified->setText(fileInfo.lastModified().toString()); } else { ui->label_modified->setVisible(false); ui->label_content_modified->setVisible(false); } if(!fileInfo.exists()) { ui->label_content_size->setVisible(false); ui->label_size->setVisible(false); ui->label_modified->setVisible(false); ui->label_content_modified->setVisible(false); } this->firstRenamingRule=firstRenamingRule; this->otherRenamingRule=otherRenamingRule; on_SuggestNewName_clicked(); }
void FileIsSameDialog::on_lineEditNewName_editingFinished() { updateRenameButton(); }
void FileIsSameDialog::on_checkBoxAlways_toggled(bool checked) { Q_UNUSED(checked); updateRenameButton(); }
void FileIsSameDialog::on_lineEditNewName_textChanged(const QString &arg1) { Q_UNUSED(arg1); updateRenameButton(); }