kitchensync
groupitem.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GROUPITEM_H
00022 #define GROUPITEM_H
00023
00024 #include "syncprocess.h"
00025
00026 #include <libqopensync/callbackhandler.h>
00027
00028 #include <kwidgetlist.h>
00029
00030 namespace QSync {
00031 class Engine;
00032 }
00033
00034 class MemberItem;
00035 class KURLLabel;
00036 class QLabel;
00037 class QProgressBar;
00038 class QVBox;
00039
00040 class GroupItem : public KWidgetListItem
00041 {
00042 Q_OBJECT
00043
00044 public:
00045 GroupItem( KWidgetList*, SyncProcess *syncProcess );
00046 ~GroupItem();
00047
00048 SyncProcess *syncProcess() const { return mSyncProcess; }
00049
00050 void update();
00051
00052 void clear();
00053
00054 signals:
00055 void synchronizeGroup( SyncProcess *syncProcess );
00056 void abortSynchronizeGroup( SyncProcess *syncProcess );
00057 void configureGroup( SyncProcess *syncProcess );
00058
00059 protected slots:
00060 void conflict( QSync::SyncMapping );
00061 void change( const QSync::SyncChangeUpdate& );
00062 void mapping( const QSync::SyncMappingUpdate& );
00063 void engine( const QSync::SyncEngineUpdate& );
00064 void member( const QSync::SyncMemberUpdate& );
00065
00066 void synchronize();
00067 void configure();
00068
00069 void engineChanged( QSync::Engine *engine );
00070
00071 private:
00072 SyncProcess *mSyncProcess;
00073 QSync::CallbackHandler *mCallbackHandler;
00074 QValueList<MemberItem*> mMemberItems;
00075
00076 QLabel *mIcon;
00077 QLabel *mGroupName;
00078 QLabel *mStatus;
00079 QLabel *mTime;
00080 KURLLabel *mSyncAction;
00081 KURLLabel *mConfigureAction;
00082 QVBox *mBox;
00083 QProgressBar *mProgressBar;
00084
00085 int mProcessedItems;
00086 int mMaxProcessedItems;
00087 bool mSynchronizing;
00088 };
00089
00090 class MemberItem : public QWidget
00091 {
00092 public:
00093 MemberItem( QWidget *parent, SyncProcess *syncProcess,
00094 const QSync::Member &member );
00095
00096 SyncProcess* syncProcess() const { return mSyncProcess; }
00097 QSync::Member member() const { return mMember; }
00098
00099 void setStatusMessage( const QString &msg );
00100
00101 private:
00102 SyncProcess *mSyncProcess;
00103 QSync::Member mMember;
00104
00105 QLabel *mIcon;
00106 QLabel *mMemberName;
00107 QLabel *mDescription;
00108 QLabel *mStatus;
00109 };
00110
00111 #endif
|