summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
Unidiff
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 139c91b..c83a5df 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -37,97 +37,97 @@ struct TodayPlugin {
37 QInterfacePtr<TodayPluginInterface> iface; 37 QInterfacePtr<TodayPluginInterface> iface;
38 TodayPluginObject *guiPart; 38 TodayPluginObject *guiPart;
39 QWidget *guiBox; 39 QWidget *guiBox;
40 QString name; 40 QString name;
41 bool active; 41 bool active;
42 bool excludeRefresh; 42 bool excludeRefresh;
43 int pos; 43 int pos;
44}; 44};
45 45
46static QValueList<TodayPlugin> pluginList; 46static QValueList<TodayPlugin> pluginList;
47 47
48static QMap<QString, TodayPlugin> tempList; 48static QMap<QString, TodayPlugin> tempList;
49 49
50Today::Today( QWidget* parent, const char* name, WFlags fl ) 50Today::Today( QWidget* parent, const char* name, WFlags fl )
51 : TodayBase( parent, name, fl ) { 51 : TodayBase( parent, name, fl ) {
52 52
53 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 53 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
54 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 54 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
55 55
56#if defined(Q_WS_QWS) 56#if defined(Q_WS_QWS)
57#if !defined(QT_NO_COP) 57#if !defined(QT_NO_COP)
58 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 58 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
59 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 59 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
60 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 60 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
61#endif 61#endif
62#endif 62#endif
63 63
64 setOwnerField(); 64 setOwnerField();
65 m_refreshTimer = new QTimer( this ); 65 m_refreshTimer = new QTimer( this );
66 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 66 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
67 m_refreshTimer->start( 15000 ); 67 m_refreshTimer->start( 15000 );
68 m_big_box = 0L; 68 m_big_box = 0L;
69 69
70 70
71 layout = new QVBoxLayout( this ); 71 layout = new QVBoxLayout( this );
72 layout->addWidget( Frame ); 72 layout->addWidget( Frame );
73 layout->addWidget( OwnerField ); 73 layout->addWidget( OwnerField );
74 74
75 m_sv = new QScrollView( this ); 75 m_sv = new QScrollView( this );
76 m_sv->setResizePolicy( QScrollView::AutoOneFit ); 76 m_sv->setResizePolicy( QScrollView::AutoOneFit );
77 m_sv->setHScrollBarMode( QScrollView::AlwaysOff ); 77 m_sv->setHScrollBarMode( QScrollView::AlwaysOff );
78 m_sv->setFrameShape( QFrame::NoFrame ); 78 m_sv->setFrameShape( QFrame::NoFrame );
79 79
80 layout->addWidget( m_sv ); 80 layout->addWidget( m_sv );
81 layout->setStretchFactor( m_sv,4 ); 81 layout->setStretchFactor( m_sv,4 );
82 82
83 qApp->processEvents(); 83 qApp->processEvents();
84 loadPlugins(); 84 loadPlugins();
85 showMaximized(); 85 QPEApplication::showWidget( this );
86} 86}
87 87
88/** 88/**
89 * Qcop receive method. 89 * Qcop receive method.
90 */ 90 */
91void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 91void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
92 QDataStream stream( data, IO_ReadOnly ); 92 QDataStream stream( data, IO_ReadOnly );
93 if ( msg == "message(QString)" ) { 93 if ( msg == "message(QString)" ) {
94 QString message; 94 QString message;
95 stream >> message; 95 stream >> message;
96 setOwnerField( message ); 96 setOwnerField( message );
97 } 97 }
98} 98}
99 99
100void Today::setRefreshTimer( int interval ) { 100void Today::setRefreshTimer( int interval ) {
101 101
102 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 102 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
103 103
104 // 0 is "never" case 104 // 0 is "never" case
105 if ( !interval == 0 ) { 105 if ( !interval == 0 ) {
106 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 106 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
107 m_refreshTimer->changeInterval( interval ); 107 m_refreshTimer->changeInterval( interval );
108 } 108 }
109} 109}
110 110
111 111
112/** 112/**
113 * Initialises the owner field with the default value, the username 113 * Initialises the owner field with the default value, the username
114 */ 114 */
115void Today::setOwnerField() { 115void Today::setOwnerField() {
116 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 116 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
117 if ( QFile::exists( file ) ) { 117 if ( QFile::exists( file ) ) {
118 Contact cont = Contact::readVCard( file )[0]; 118 Contact cont = Contact::readVCard( file )[0];
119 QString returnString = cont.fullName(); 119 QString returnString = cont.fullName();
120 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 120 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
121 } else { 121 } else {
122 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 122 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
123 } 123 }
124} 124}
125 125
126/** 126/**
127 * Set the owner field with a given QString, for example per qcop. 127 * Set the owner field with a given QString, for example per qcop.
128 */ 128 */
129void Today::setOwnerField( QString &message ) { 129void Today::setOwnerField( QString &message ) {
130 if ( !message.isEmpty() ) { 130 if ( !message.isEmpty() ) {
131 OwnerField->setText( "<b>" + message + "</b>" ); 131 OwnerField->setText( "<b>" + message + "</b>" );
132 } 132 }
133} 133}