mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 23:15:14 -04:00
ya se puede editar la informaci?n de los comics adecuadamente.
ya se puede hacer import de los datos de c?mics
This commit is contained in:
@ -369,3 +369,78 @@ bool YACReaderSortComics::lessThan(const QModelIndex &left, const QModelIndex &r
|
||||
|
||||
return naturalSortLessThanCI(leftString,rightString);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------
|
||||
|
||||
YACReaderFieldEdit::YACReaderFieldEdit(QWidget * parent)
|
||||
:QLineEdit(parent)
|
||||
{
|
||||
setPlaceholderText(tr("Click to overwrite"));
|
||||
setModified(false);
|
||||
restore = new QAction(tr("Restore to default"),this);
|
||||
this->addAction(restore);
|
||||
//this->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
}
|
||||
|
||||
void YACReaderFieldEdit::focusInEvent(QFocusEvent* e)
|
||||
{
|
||||
if (e->reason() == Qt::MouseFocusReason)
|
||||
{
|
||||
setModified(true);
|
||||
setPlaceholderText("");
|
||||
}
|
||||
|
||||
QLineEdit::focusInEvent(e);
|
||||
}
|
||||
|
||||
void YACReaderFieldEdit::clear()
|
||||
{
|
||||
setModified(false);
|
||||
setPlaceholderText(tr("Click to overwrite"));
|
||||
QLineEdit::clear();
|
||||
}
|
||||
|
||||
void YACReaderFieldEdit::setDisabled(bool disabled)
|
||||
{
|
||||
if(disabled)
|
||||
setPlaceholderText("");
|
||||
QLineEdit::setDisabled(disabled);
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
|
||||
YACReaderFieldPlainTextEdit::YACReaderFieldPlainTextEdit(QWidget * parent)
|
||||
:QPlainTextEdit(parent)
|
||||
{
|
||||
document()->setModified(false);
|
||||
setPlainText(tr("Click to overwrite"));
|
||||
restore = new QAction(tr("Restore to default"),this);
|
||||
this->addAction(restore);
|
||||
//this->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
}
|
||||
|
||||
void YACReaderFieldPlainTextEdit::focusInEvent(QFocusEvent* e)
|
||||
{
|
||||
if (e->reason() == Qt::MouseFocusReason)
|
||||
{
|
||||
document()->setModified(true);
|
||||
setPlainText("");
|
||||
}
|
||||
|
||||
QPlainTextEdit::focusInEvent(e);
|
||||
}
|
||||
|
||||
void YACReaderFieldPlainTextEdit::clear()
|
||||
{
|
||||
QPlainTextEdit::clear();
|
||||
document()->setModified(false);
|
||||
setPlainText(tr("Click to overwrite"));
|
||||
}
|
||||
|
||||
void YACReaderFieldPlainTextEdit::setDisabled(bool disabled)
|
||||
{
|
||||
if(disabled)
|
||||
setPlainText(tr("Click to overwrite"));
|
||||
QPlainTextEdit::setDisabled(disabled);
|
||||
}
|
@ -17,7 +17,9 @@
|
||||
#include <QModelIndex>
|
||||
#include <QRegExp>
|
||||
#include <QHash>
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QAction>
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
#include "pictureflow.h"
|
||||
|
||||
@ -134,5 +136,34 @@ class YACReaderSortComics : public QSortFilterProxyModel
|
||||
};
|
||||
|
||||
void delTree(QDir dir);
|
||||
|
||||
|
||||
class YACReaderFieldEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
YACReaderFieldEdit(QWidget * parent = 0);
|
||||
void clear();
|
||||
void setDisabled(bool disabled);
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent* e);
|
||||
private:
|
||||
QAction * restore;
|
||||
|
||||
};
|
||||
|
||||
class YACReaderFieldPlainTextEdit : public QPlainTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
YACReaderFieldPlainTextEdit(QWidget * parent = 0);
|
||||
void clear();
|
||||
void setDisabled(bool disabled);
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent* e);
|
||||
private:
|
||||
QAction * restore;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user