]> Some of my projects - AniAdd.git/commitdiff
Add SettingState to model & ui.
authorAPTX <marek321@gmail.com>
Mon, 8 Aug 2011 23:25:44 +0000 (01:25 +0200)
committerAPTX <marek321@gmail.com>
Mon, 8 Aug 2011 23:25:44 +0000 (01:25 +0200)
filemodel.cpp
filemodel.h
qml/AniAdd/Components/FileDelegate.qml
qml/AniAdd/Components/StatusIndicator.qml

index d6728fdb5f20bd4290a1abddefb5468d8d43aa4c..c07bb01d1cfffb2ac223db9a17bbcd2c7985b5bb 100644 (file)
@@ -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;
        }
index aa8e110ab1541a08f045b7661fb92018b9f8bdfd..5542f02ed10c2b23afd8e892d84dad580ea60c24 100644 (file)
@@ -29,7 +29,8 @@ public:
                HashingState,
                RenamingState,
                AddingState,
-               MarkingState
+               MarkingState,
+               SettingStateState
        };
 
        FileModel(QObject *parent = 0);
index f554355f6f0e954aadc8881396a8c04a84c93d10..d6e818d3a3135df8936620fd3967c20feecc8843 100644 (file)
@@ -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 }
                }
        }
index d4dbf66e59912d89285c0b107453656028b26eec..59634da4f1d55f6492835716c7673e09e1fe7889 100644 (file)
@@ -56,7 +56,7 @@ Item {
                        }
                },
                State {
-                       when: state == 4
+                       when: state & 4
                        PropertyChanges {
                                target: statusIndicator
                                color: "#22AA33"