-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 7 | ||||
-rw-r--r-- | microkde/kapplication.cpp | 15 | ||||
-rw-r--r-- | microkde/kapplication.h | 1 | ||||
-rw-r--r-- | microkde/kresources/factory.cpp | 6 |
4 files changed, 25 insertions, 4 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index c60b566..029f14b 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp | |||
@@ -99,33 +99,33 @@ void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) | |||
99 | setCursor( splitVCursor ); | 99 | setCursor( splitVCursor ); |
100 | #endif | 100 | #endif |
101 | } | 101 | } |
102 | 102 | ||
103 | 103 | ||
104 | void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) | 104 | void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) |
105 | { | 105 | { |
106 | updateCursor( e->pos() ); | 106 | updateCursor( e->pos() ); |
107 | if ( !(e->state()&LeftButton) ) | 107 | if ( !(e->state()&LeftButton) ) |
108 | return; | 108 | return; |
109 | 109 | ||
110 | if ( _activeButton != 0) | 110 | if ( _activeButton != 0) |
111 | return; | 111 | return; |
112 | 112 | ||
113 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) | 113 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) |
114 | - mouseOffset; | 114 | - mouseOffset; |
115 | if ( true /*opaque()*/ ) { | 115 | if ( opaque() ) { |
116 | s->moveSplitter( pos, id() ); | 116 | s->moveSplitter( pos, id() ); |
117 | } else { | 117 | } else { |
118 | int min = pos; int max = pos; | 118 | int min = pos; int max = pos; |
119 | s->getRange( id(), &min, &max ); | 119 | s->getRange( id(), &min, &max ); |
120 | s->setRubberband( QMAX( min, QMIN(max, pos ))); | 120 | s->setRubberband( QMAX( min, QMIN(max, pos ))); |
121 | } | 121 | } |
122 | _collapsed = false; | 122 | _collapsed = false; |
123 | } | 123 | } |
124 | 124 | ||
125 | void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) | 125 | void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) |
126 | { | 126 | { |
127 | if ( e->button() == LeftButton ) { | 127 | if ( e->button() == LeftButton ) { |
128 | _activeButton = onButton( e->pos() ); | 128 | _activeButton = onButton( e->pos() ); |
129 | mouseOffset = s->pick(e->pos()); | 129 | mouseOffset = s->pick(e->pos()); |
130 | mMouseDown = true; | 130 | mMouseDown = true; |
131 | repaint(); | 131 | repaint(); |
@@ -470,32 +470,37 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() | |||
470 | { | 470 | { |
471 | #if QT_VERSION >= 232 | 471 | #if QT_VERSION >= 232 |
472 | data->list.setAutoDelete( TRUE ); | 472 | data->list.setAutoDelete( TRUE ); |
473 | delete data; | 473 | delete data; |
474 | #endif | 474 | #endif |
475 | } | 475 | } |
476 | 476 | ||
477 | 477 | ||
478 | #if QT_VERSION >= 232 | 478 | #if QT_VERSION >= 232 |
479 | void KDGanttMinimizeSplitter::init() | 479 | void KDGanttMinimizeSplitter::init() |
480 | { | 480 | { |
481 | data = new QSplitterData; | 481 | data = new QSplitterData; |
482 | if ( orient == Horizontal ) | 482 | if ( orient == Horizontal ) |
483 | setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); | 483 | setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); |
484 | else | 484 | else |
485 | setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); | 485 | setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); |
486 | #ifndef DESKTOP_VERSION | ||
487 | setOpaqueResize( false ); | ||
488 | #else | ||
489 | setOpaqueResize( true ); | ||
490 | #endif | ||
486 | } | 491 | } |
487 | #endif | 492 | #endif |
488 | 493 | ||
489 | 494 | ||
490 | void KDGanttMinimizeSplitter::toggle() | 495 | void KDGanttMinimizeSplitter::toggle() |
491 | { | 496 | { |
492 | if ( mFirstHandle ) | 497 | if ( mFirstHandle ) |
493 | mFirstHandle->toggle(); | 498 | mFirstHandle->toggle(); |
494 | else | 499 | else |
495 | qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available "); | 500 | qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available "); |
496 | 501 | ||
497 | } | 502 | } |
498 | 503 | ||
499 | 504 | ||
500 | /*! | 505 | /*! |
501 | \brief the orientation of the splitter | 506 | \brief the orientation of the splitter |
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f05b91b..80a83e0 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -33,32 +33,47 @@ QString KApplication::randomString(int length) | |||
33 | } | 33 | } |
34 | return str; | 34 | return str; |
35 | } | 35 | } |
36 | int KApplication::execDialog( QDialog* d ) | 36 | int KApplication::execDialog( QDialog* d ) |
37 | { | 37 | { |
38 | if (QApplication::desktop()->width() <= 640 ) | 38 | if (QApplication::desktop()->width() <= 640 ) |
39 | d->showMaximized(); | 39 | d->showMaximized(); |
40 | else | 40 | else |
41 | ;//d->resize( 800, 600 ); | 41 | ;//d->resize( 800, 600 ); |
42 | return d->exec(); | 42 | return d->exec(); |
43 | } | 43 | } |
44 | void KApplication::showLicence() | 44 | void KApplication::showLicence() |
45 | { | 45 | { |
46 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); | 46 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); |
47 | } | 47 | } |
48 | 48 | ||
49 | void KApplication::testCoords( int* x, int* y, int* wid, int * hei ) | ||
50 | { | ||
51 | int dWid = QApplication::desktop()->width() ; | ||
52 | int dHei = QApplication::desktop()->height(); | ||
53 | if ( *x + *wid > dWid ) { | ||
54 | *x = 0; | ||
55 | if ( *wid > dWid ) | ||
56 | *wid = dWid; | ||
57 | } | ||
58 | if ( *y + *hei > dHei ) { | ||
59 | *y = 0; | ||
60 | if ( *hei > dHei ) | ||
61 | *hei = dHei; | ||
62 | } | ||
63 | } | ||
49 | void KApplication::showFile(QString caption, QString fn) | 64 | void KApplication::showFile(QString caption, QString fn) |
50 | { | 65 | { |
51 | QString text; | 66 | QString text; |
52 | QString fileName; | 67 | QString fileName; |
53 | #ifndef DESKTOP_VERSION | 68 | #ifndef DESKTOP_VERSION |
54 | fileName = getenv("QPEDIR"); | 69 | fileName = getenv("QPEDIR"); |
55 | fileName += "/pics/" + fn ; | 70 | fileName += "/pics/" + fn ; |
56 | #else | 71 | #else |
57 | fileName = qApp->applicationDirPath () + "/" + fn; | 72 | fileName = qApp->applicationDirPath () + "/" + fn; |
58 | #endif | 73 | #endif |
59 | QFile file( fileName ); | 74 | QFile file( fileName ); |
60 | if (!file.open( IO_ReadOnly ) ) { | 75 | if (!file.open( IO_ReadOnly ) ) { |
61 | return ; | 76 | return ; |
62 | } | 77 | } |
63 | QTextStream ts( &file ); | 78 | QTextStream ts( &file ); |
64 | text = ts.read(); | 79 | text = ts.read(); |
diff --git a/microkde/kapplication.h b/microkde/kapplication.h index 497ec2f..f7eb1ef 100644 --- a/microkde/kapplication.h +++ b/microkde/kapplication.h | |||
@@ -8,23 +8,24 @@ | |||
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | class KApplication | 10 | class KApplication |
11 | { | 11 | { |
12 | public: | 12 | public: |
13 | static int random(); | 13 | static int random(); |
14 | 14 | ||
15 | //US | 15 | //US |
16 | /** | 16 | /** |
17 | * Generates a random string. It operates in the range [A-Za-z0-9] | 17 | * Generates a random string. It operates in the range [A-Za-z0-9] |
18 | * @param length Generate a string of this length. | 18 | * @param length Generate a string of this length. |
19 | * @return the random string | 19 | * @return the random string |
20 | */ | 20 | */ |
21 | static QString randomString(int length); | 21 | static QString randomString(int length); |
22 | static int execDialog( QDialog* ); | 22 | static int execDialog( QDialog* ); |
23 | static void showLicence(); | 23 | static void showLicence(); |
24 | static void testCoords( int* x, int* y, int* wid, int * hei ); | ||
24 | static void showFile(QString caption, QString file); | 25 | static void showFile(QString caption, QString file); |
25 | static void showText(QString caption, QString text); | 26 | static void showText(QString caption, QString text); |
26 | static bool convert2latin1(QString file); | 27 | static bool convert2latin1(QString file); |
27 | }; | 28 | }; |
28 | 29 | ||
29 | 30 | ||
30 | #endif | 31 | #endif |
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp index 3d1889f..a3b7fff 100644 --- a/microkde/kresources/factory.cpp +++ b/microkde/kresources/factory.cpp | |||
@@ -67,45 +67,45 @@ Factory::Factory( const QString& resourceFamily) : | |||
67 | /*US | 67 | /*US |
68 | 68 | ||
69 | KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin", QString( "[X-KDE-ResourceFamily] == '%1'" ) | 69 | KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin", QString( "[X-KDE-ResourceFamily] == '%1'" ) |
70 | .arg( resourceFamily ) ); | 70 | .arg( resourceFamily ) ); |
71 | KTrader::OfferList::ConstIterator it; | 71 | KTrader::OfferList::ConstIterator it; |
72 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { | 72 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { |
73 | QVariant type = (*it)->property( "X-KDE-ResourceType" ); | 73 | QVariant type = (*it)->property( "X-KDE-ResourceType" ); |
74 | if ( !type.toString().isEmpty() ) | 74 | if ( !type.toString().isEmpty() ) |
75 | mTypeMap.insert( type.toString(), *it ); | 75 | mTypeMap.insert( type.toString(), *it ); |
76 | } | 76 | } |
77 | */ | 77 | */ |
78 | 78 | ||
79 | //US new | 79 | //US new |
80 | PluginInfo* info = new PluginInfo; | 80 | PluginInfo* info = new PluginInfo; |
81 | info->library = "microkabc_file"; | 81 | info->library = "microkabc_file"; |
82 | info->nameLabel = i18n( "file" ); | 82 | info->nameLabel = i18n( "file" ); |
83 | info->descriptionLabel = i18n( "Choose one file" ); | 83 | info->descriptionLabel = i18n( "One file" ); |
84 | mTypeMap.insert( "file", info ); | 84 | mTypeMap.insert( "file", info ); |
85 | 85 | ||
86 | info = new PluginInfo; | 86 | info = new PluginInfo; |
87 | info->library = "microkabc_dir"; | 87 | info->library = "microkabc_dir"; |
88 | info->nameLabel = i18n( "dir" ); | 88 | info->nameLabel = i18n( "dir" ); |
89 | info->descriptionLabel = i18n( "Choose a directory with may files" ); | 89 | info->descriptionLabel = i18n( "A directory with many files" ); |
90 | mTypeMap.insert( "dir", info ); | 90 | mTypeMap.insert( "dir", info ); |
91 | 91 | ||
92 | info = new PluginInfo; | 92 | info = new PluginInfo; |
93 | info->library = "microkabc_ldap"; | 93 | info->library = "microkabc_ldap"; |
94 | info->nameLabel = i18n( "ldap" ); | 94 | info->nameLabel = i18n( "ldap" ); |
95 | info->descriptionLabel = i18n( "No description available" ); | 95 | info->descriptionLabel = i18n( "Connect to a directory server" ); |
96 | mTypeMap.insert( "ldap", info ); | 96 | mTypeMap.insert( "ldap", info ); |
97 | 97 | ||
98 | //US add opie plugin only, if the library exists. | 98 | //US add opie plugin only, if the library exists. |
99 | /*US | 99 | /*US |
100 | QString libname = "microkabc_opie"; | 100 | QString libname = "microkabc_opie"; |
101 | QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); | 101 | QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); |
102 | if ( !path.isEmpty() ) | 102 | if ( !path.isEmpty() ) |
103 | { | 103 | { |
104 | info = new PluginInfo; | 104 | info = new PluginInfo; |
105 | info->library = libname; | 105 | info->library = libname; |
106 | info->nameLabel = i18n( "opie" ); | 106 | info->nameLabel = i18n( "opie" ); |
107 | info->descriptionLabel = i18n( "Opie PIM Addressbook." ); | 107 | info->descriptionLabel = i18n( "Opie PIM Addressbook." ); |
108 | mTypeMap.insert( "opie", info ); | 108 | mTypeMap.insert( "opie", info ); |
109 | } | 109 | } |
110 | */ | 110 | */ |
111 | //US add qtopia plugin only, if the library exists. | 111 | //US add qtopia plugin only, if the library exists. |