summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.h3
-rw-r--r--microkde/kdialog.cpp48
-rw-r--r--microkde/kdialog.h20
3 files changed, 69 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index e6738b6..d3734da 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -9,48 +9,49 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
$Id$
*/
#ifndef _KSYNCMANAGER_H
#define _KSYNCMANAGER_H
#include <qobject.h>
#include <qstring.h>
#include <qsocket.h>
#include <qdatetime.h>
#include <qserversocket.h>
#include <qtextstream.h>
#include <qregexp.h>
#include <qprogressdialog.h>
+#include <kdialog.h>
class QPopupMenu;
class KSyncProfile;
class KPimPrefs;
class QWidget;
class KSyncManager;
class KSyncInterface;
class QProgressBar;
class KServerSocket : public QServerSocket
{
Q_OBJECT
public:
KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 );
void newConnection ( int socket ) ;
void setFileName( QString fn ) {mFileName = fn;};
signals:
void file_received( bool );
void request_file();
void saveFile();
void endConnect();
@@ -78,49 +79,49 @@ class KServerSocket : public QServerSocket
class KCommandSocket : public QObject
{
Q_OBJECT
public:
enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet };
KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 );
void readFile( QString );
void writeFile( QString );
void sendStop();
private slots :
void sendFileRequest();
void updateConnectDialog();
signals:
void commandFinished( KCommandSocket*, int );
private slots:
void startReadFileFromSocket();
void readFileFromSocket();
void deleteSocket();
void writeFileToSocket();
private :
int mConnectCount;
int mConnectMax;
- QProgressDialog mConnectProgress;
+ KProgressDialog mConnectProgress;
QWidget* tlw;
QSocket* mSocket;
QString mPassWord;
Q_UINT16 mPort;
QString mHost;
QString mFileName;
QTimer* mTimerSocket;
int mRetVal;
QTime mTime;
QString mFileString;
bool mFirst;
bool mFirstLine;
};
class KSyncManager : public QObject
{
Q_OBJECT
public:
enum TargetApp {
KOPI = 0,
KAPI = 1,
PWMPI = 2 };
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp
index 961631e..f9e0126 100644
--- a/microkde/kdialog.cpp
+++ b/microkde/kdialog.cpp
@@ -1,25 +1,71 @@
#include <kdialog.h>
#include <qapp.h>
-
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qprogressbar.h>
+#include <klocale.h>
KDialog::KDialog( QWidget *parent, const char *name, bool modal ) :
QDialog( parent, name, modal )
{
;
}
#ifdef DESKTOP_VERSION
int KDialog::spacingHint() { return 7; }
int KDialog::marginHint() { return 7; }
int KDialog::spacingHintSmall() { return 4; }
int KDialog::marginHintSmall() { return 4; }
#else
int KDialog::spacingHint() { return 3; }
int KDialog::marginHint() { return 3; }
int KDialog::spacingHintSmall() { return 1; }
int KDialog::marginHintSmall() { return 1; }
#endif
+KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) :
+ QDialog( parent, name, modal )
+{
+ QVBoxLayout* lay= new QVBoxLayout ( this );
+ mLabel = new QLabel ( "abc",this );
+ mBar = new QProgressBar ( this );
+ mButton = new QPushButton ( i18n("Cancel"),this );
+ lay->addWidget ( mLabel );
+ lay->addWidget ( mBar );
+ lay->addWidget ( mButton );
+ connect ( mButton , SIGNAL ( clicked () ), this, SIGNAL ( cancelled () ));
+ resize ( 220, sizeHint().height() +mLabel->sizeHint().height());
+
+}
+
+void KProgressDialog::setLabelText ( const QString & t)
+{
+ mLabel->setText( t );
+}
+
+void KProgressDialog::setTotalSteps ( int totalSteps )
+{
+ setActiveWindow();
+ setFocus();
+ mBar->setTotalSteps ( totalSteps );
+}
+void KProgressDialog::setProgress ( int progress )
+{
+ setActiveWindow();
+ setFocus();
+ mBar->setProgress ( progress );
+}
+void KProgressDialog::accept()
+{
+
+ // QDialog::accept();
+}
+void KProgressDialog::reject()
+{
+ emit cancelled ();
+ //QDialog::reject();
+}
diff --git a/microkde/kdialog.h b/microkde/kdialog.h
index 703d268..bc80689 100644
--- a/microkde/kdialog.h
+++ b/microkde/kdialog.h
@@ -1,18 +1,38 @@
#ifndef MINIKDE_KDIALOG_H
#define MINIKDE_KDIALOG_H
#include <qdialog.h>
+class QLabel;
+class QProgressBar;
+class QPushButton ;
class KDialog : public QDialog
{
Q_OBJECT
public:
KDialog( QWidget *parent=0, const char *name=0, bool modal=true );
static int spacingHint();
static int marginHint();
static int spacingHintSmall();
static int marginHintSmall();
};
+class KProgressDialog : public QDialog
+{
+ Q_OBJECT
+ public:
+ KProgressDialog( QWidget *parent=0, const char *name=0, bool modal=false );
+ void setLabelText ( const QString & );
+ void setTotalSteps ( int totalSteps );
+ void setProgress ( int progress );
+ void accept();
+ void reject();
+ private:
+ QLabel * mLabel;
+ QProgressBar *mBar;
+ QPushButton *mButton;
+ signals:
+ void cancelled ();
+};
#endif