From: APTX Date: Mon, 8 Aug 2011 23:25:44 +0000 (+0200) Subject: Add SettingState to model & ui. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=07fb13a512cda9ca00c54af4de10585abc4c11ca;p=AniAdd.git Add SettingState to model & ui. --- diff --git a/filemodel.cpp b/filemodel.cpp index d6728fd..c07bb01 100644 --- a/filemodel.cpp +++ b/filemodel.cpp @@ -17,6 +17,7 @@ FileModel::FileModel(QObject *parent) : QAbstractTableModel(parent), renameDeleg roles[RenamingState] = "renamingState"; roles[AddingState] = "addingState"; roles[MarkingState] = "markingState"; + roles[SettingStateState]= "settingStateState"; setRoleNames(roles); renameDelegate->setRenameEngine(new RenameParser::RenameEngine()); @@ -104,6 +105,7 @@ void FileModel::start() { file->rename(); file->addToMyList(); + file->updateState(); } } @@ -116,7 +118,7 @@ int FileModel::rowCount(const QModelIndex &parent) const int FileModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); - return 5; + return 6; } QVariant FileModel::data(const QModelIndex &index, int role) const @@ -146,6 +148,8 @@ QVariant FileModel::data(const QModelIndex &index, int role) const case MarkingState: return f->markingState(); break; + case SettingStateState: + return f->settingStateState(); default: return QVariant(); break; @@ -163,6 +167,9 @@ QVariant FileModel::data(const QModelIndex &index, int role) const case 4: return getDescForActionState(f->markingState(), role); break; + case 5: + return getDescForActionState(f->settingStateState(), role); + break; default: break; } @@ -189,6 +196,8 @@ QVariant FileModel::headerData(int section, Qt::Orientation orientation, int rol return tr("Adding"); case 4: return tr("Marking"); + case 5: + return tr("Setting State"); default: break; } diff --git a/filemodel.h b/filemodel.h index aa8e110..5542f02 100644 --- a/filemodel.h +++ b/filemodel.h @@ -29,7 +29,8 @@ public: HashingState, RenamingState, AddingState, - MarkingState + MarkingState, + SettingStateState }; FileModel(QObject *parent = 0); diff --git a/qml/AniAdd/Components/FileDelegate.qml b/qml/AniAdd/Components/FileDelegate.qml index f554355..d6e818d 100644 --- a/qml/AniAdd/Components/FileDelegate.qml +++ b/qml/AniAdd/Components/FileDelegate.qml @@ -87,6 +87,11 @@ Component { idChar: "A" state: addingState } + StatusIndicator { + id: settingStateStateStatus + idChar: "S" + state: settingStateState + } } } } @@ -122,13 +127,20 @@ Component { ] ListView.onAdd: SequentialAnimation { - PropertyAction { target: wrapper; property: "y"; value: wrapper.ListView.y + wrapper.ListView.height } - NumberAnimation { target: wrapper; property: "y"; to: 0; duration: 250; easing.type: Easing.InOutQuad } + PropertyAction { target: wrapper; property: "opacity"; value: 0 } + PropertyAction { target: wrapper; property: "height"; value: 0 } + ParallelAnimation { + NumberAnimation { target: wrapper; property: "height"; to: 50; duration: 5000; easing.type: Easing.InOutQuad } + NumberAnimation { target: wrapper; property: "opacity"; to: 1; duration: 5000; easing.type: Easing.InOutQuad } + } } ListView.onRemove: SequentialAnimation { PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad } + ParallelAnimation { + NumberAnimation { target: wrapper; property: "height"; to: 0; duration: 1000; easing.type: Easing.InOutQuad } + NumberAnimation { target: wrapper; property: "opacity"; to: 0; duration: 500; easing.type: Easing.InOutQuad } + } PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } } } diff --git a/qml/AniAdd/Components/StatusIndicator.qml b/qml/AniAdd/Components/StatusIndicator.qml index d4dbf66..59634da 100644 --- a/qml/AniAdd/Components/StatusIndicator.qml +++ b/qml/AniAdd/Components/StatusIndicator.qml @@ -56,7 +56,7 @@ Item { } }, State { - when: state == 4 + when: state & 4 PropertyChanges { target: statusIndicator color: "#22AA33"