kitchensync
actionpart.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <kdebug.h>
00024
00025 #include "actionpart.h"
00026
00027 #include "core.h"
00028
00029 using namespace KSync;
00030
00031 ActionPart::ActionPart( QObject *parent, const char *name )
00032 : KParts::Part( parent, name )
00033 {
00034 m_window = 0;
00035
00036 if ( parent && parent->inherits("KSync::Core") )
00037 m_window = static_cast<KSync::Core *>( parent );
00038 }
00039
00040 ActionPart::~ActionPart()
00041 {
00042 }
00043
00044 int ActionPart::syncProgress() const
00045 {
00046 return m_prog;
00047 }
00048
00049 int ActionPart::syncStatus() const
00050 {
00051 return m_stat;
00052 }
00053
00054 bool ActionPart::hasGui() const
00055 {
00056 return false;
00057 }
00058
00059 bool ActionPart::configIsVisible() const
00060 {
00061 return false;
00062 }
00063
00064 bool ActionPart::canSync() const
00065 {
00066 return false;
00067 }
00068
00069 QWidget *ActionPart::configWidget()
00070 {
00071 return 0;
00072 }
00073
00074 void ActionPart::sync( const SynceeList& , SynceeList& )
00075 {
00076 done();
00077 }
00078
00079 Core* ActionPart::core()
00080 {
00081 return m_window;
00082 }
00083
00084 Core* ActionPart::core() const
00085 {
00086 return m_window;
00087 }
00088
00089 void ActionPart::done()
00090 {
00091 m_stat = SYNC_DONE;
00092 }
00093
00094 void ActionPart::slotConfigOk()
00095 {
00096 }
00097
00098 void ActionPart::connectPartChange( const char *slot )
00099 {
00100 connect( core(), SIGNAL( partChanged( ActionPart * ) ), slot );
00101 }
00102
00103 void ActionPart::connectSyncProgress( const char *slot )
00104 {
00105 connect( core(), SIGNAL( syncProgress( ActionPart *, int, int ) ), slot );
00106 }
00107
00108 void ActionPart::connectProfileChanged( const char *slot )
00109 {
00110 connect( core(), SIGNAL( profileChanged( const Profile & ) ), slot );
00111 }
00112
00113 void ActionPart::connectKonnectorDownloaded( const char *slot )
00114 {
00115 connect( core(),
00116 SIGNAL( konnectorDownloaded( Konnector *, Syncee::PtrList ) ),
00117 slot );
00118 }
00119
00120 void ActionPart::connectStartSync( const char *slot )
00121 {
00122 connect( core(), SIGNAL( startSync() ), slot );
00123 }
00124
00125 void ActionPart::connectDoneSync( const char *slot )
00126 {
00127 connect( core(), SIGNAL( doneSync() ), slot );
00128 }
00129
00130 bool ActionPart::confirmBeforeWriting() const
00131 {
00132 return core()->currentProfile().confirmSync();
00133 }
00134
00135 #include "actionpart.moc"
|