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 TQLabel;
00037 class TQProgressBar;
00038 class TQVBox;
00039
00040 class GroupItem : public KWidgetListItem
00041 {
00042 Q_OBJECT
00043
00044
00045 public:
00046 GroupItem( KWidgetList*, SyncProcess *syncProcess );
00047 ~GroupItem();
00048
00049 SyncProcess *syncProcess() const { return mSyncProcess; }
00050
00051 void update();
00052
00053 void clear();
00054
00055 signals:
00056 void synchronizeGroup( SyncProcess *syncProcess );
00057 void abortSynchronizeGroup( SyncProcess *syncProcess );
00058 void configureGroup( SyncProcess *syncProcess );
00059
00060 protected slots:
00061 void conflict( QSync::SyncMapping );
00062 void change( const QSync::SyncChangeUpdate& );
00063 void mapping( const QSync::SyncMappingUpdate& );
00064 void engine( const QSync::SyncEngineUpdate& );
00065 void member( const QSync::SyncMemberUpdate& );
00066
00067 void synchronize();
00068 void configure();
00069
00070 void engineChanged( QSync::Engine *engine );
00071
00072 private:
00073 SyncProcess *mSyncProcess;
00074 QSync::CallbackHandler *mCallbackHandler;
00075 TQValueList<MemberItem*> mMemberItems;
00076
00077 TQLabel *mIcon;
00078 TQLabel *mGroupName;
00079 TQLabel *mStatus;
00080 TQLabel *mTime;
00081 KURLLabel *mSyncAction;
00082 KURLLabel *mConfigureAction;
00083 TQVBox *mBox;
00084 TQProgressBar *mProgressBar;
00085
00086 int mProcessedItems;
00087 int mMaxProcessedItems;
00088 bool mSynchronizing;
00089 };
00090
00091 class MemberItem : public TQWidget
00092 {
00093 public:
00094 MemberItem( TQWidget *parent, SyncProcess *syncProcess,
00095 const QSync::Member &member );
00096
00097 SyncProcess* syncProcess() const { return mSyncProcess; }
00098 QSync::Member member() const { return mMember; }
00099
00100 void setStatusMessage( const TQString &msg );
00101
00102 private:
00103 SyncProcess *mSyncProcess;
00104 QSync::Member mMember;
00105
00106 TQLabel *mIcon;
00107 TQLabel *mMemberName;
00108 TQLabel *mDescription;
00109 TQLabel *mStatus;
00110 };
00111
00112 #endif
|