-rw-r--r-- | libopie2/qt3/opieui/ocombobox.cpp | 20 | ||||
-rw-r--r-- | libopie2/qt3/opieui/ocompletionbox.cpp | 10 | ||||
-rw-r--r-- | libopie2/qt3/opieui/ojanuswidget.cpp | 10 | ||||
-rw-r--r-- | libopie2/qt3/opieui/olineedit.cpp | 24 |
4 files changed, 32 insertions, 32 deletions
diff --git a/libopie2/qt3/opieui/ocombobox.cpp b/libopie2/qt3/opieui/ocombobox.cpp index 8dbda8f..bd330e0 100644 --- a/libopie2/qt3/opieui/ocombobox.cpp +++ b/libopie2/qt3/opieui/ocombobox.cpp | |||
@@ -319,38 +319,38 @@ void OComboBox::create( WId id, bool initializeWindow, bool destroyOldWindow ) | |||
319 | void OComboBox::setLineEdit( OLineEdit *edit ) | 319 | void OComboBox::setLineEdit( OLineEdit *edit ) |
320 | { | 320 | { |
321 | #if QT_VERSION > 290 | 321 | #if QT_VERSION > 290 |
322 | QComboBox::setLineEdit( edit ); | 322 | QComboBox::setLineEdit( edit ); |
323 | if ( !edit->inherits( "OLineEdit" ) ) | 323 | if ( !edit->inherits( "OLineEdit" ) ) |
324 | d->olineEdit = 0; | 324 | d->olineEdit = 0; |
325 | else | 325 | else |
326 | d->olineEdit = static_cast<OLineEdit*>( edit ); | 326 | d->olineEdit = static_cast<OLineEdit*>( edit ); |
327 | setDelegate( d->olineEdit ); | 327 | setDelegate( d->olineEdit ); |
328 | 328 | ||
329 | // forward some signals. We only emit returnPressed() ourselves. | 329 | // forward some signals. We only emit returnPressed() ourselves. |
330 | if ( d->olineEdit ) { | 330 | if ( d->olineEdit ) { |
331 | connect( d->olineEdit, SIGNAL( completion( const QString& )), | 331 | connect( d->olineEdit, SIGNAL( completion(const QString&)), |
332 | SIGNAL( completion( const QString& )) ); | 332 | SIGNAL( completion(const QString&)) ); |
333 | connect( d->olineEdit, SIGNAL( substringCompletion( const QString& )), | 333 | connect( d->olineEdit, SIGNAL( substringCompletion(const QString&)), |
334 | SIGNAL( substringCompletion( const QString& )) ); | 334 | SIGNAL( substringCompletion(const QString&)) ); |
335 | connect( d->olineEdit, | 335 | connect( d->olineEdit, |
336 | SIGNAL( textRotation( OCompletionBase::KeyBindingType )), | 336 | SIGNAL( textRotation(OCompletionBase::KeyBindingType)), |
337 | SIGNAL( textRotation( OCompletionBase::KeyBindingType )) ); | 337 | SIGNAL( textRotation(OCompletionBase::KeyBindingType)) ); |
338 | connect( d->olineEdit, | 338 | connect( d->olineEdit, |
339 | SIGNAL( completionModeChanged( OGlobalSettings::Completion )), | 339 | SIGNAL( completionModeChanged(OGlobalSettings::Completion)), |
340 | SIGNAL( completionModeChanged( OGlobalSettings::Completion))); | 340 | SIGNAL( completionModeChanged(OGlobalSettings::Completion))); |
341 | 341 | ||
342 | connect( d->olineEdit, | 342 | connect( d->olineEdit, |
343 | SIGNAL( aboutToShowContextMenu( QPopupMenu * )), | 343 | SIGNAL( aboutToShowContextMenu(QPopupMenu*)), |
344 | SIGNAL( aboutToShowContextMenu( QPopupMenu * )) ); | 344 | SIGNAL( aboutToShowContextMenu(QPopupMenu*)) ); |
345 | } | 345 | } |
346 | #else | 346 | #else |
347 | #warning OComboBox is not fully functional with Qt2 | 347 | #warning OComboBox is not fully functional with Qt2 |
348 | #endif | 348 | #endif |
349 | } | 349 | } |
350 | 350 | ||
351 | // Temporary functions until QT3 appears. - Seth Chaiklin 20 may 2001 | 351 | // Temporary functions until QT3 appears. - Seth Chaiklin 20 may 2001 |
352 | void OComboBox::deleteWordForward() | 352 | void OComboBox::deleteWordForward() |
353 | { | 353 | { |
354 | lineEdit()->cursorWordForward(TRUE); | 354 | lineEdit()->cursorWordForward(TRUE); |
355 | #if QT_VERSION > 290 | 355 | #if QT_VERSION > 290 |
356 | if ( lineEdit()->hasSelectedText() ) | 356 | if ( lineEdit()->hasSelectedText() ) |
diff --git a/libopie2/qt3/opieui/ocompletionbox.cpp b/libopie2/qt3/opieui/ocompletionbox.cpp index b594b8e..b36123e 100644 --- a/libopie2/qt3/opieui/ocompletionbox.cpp +++ b/libopie2/qt3/opieui/ocompletionbox.cpp | |||
@@ -58,32 +58,32 @@ OCompletionBox::OCompletionBox( QWidget *parent, const char *name ) | |||
58 | setColumnMode( 1 ); | 58 | setColumnMode( 1 ); |
59 | setLineWidth( 1 ); | 59 | setLineWidth( 1 ); |
60 | setFrameStyle( QFrame::Box | QFrame::Plain ); | 60 | setFrameStyle( QFrame::Box | QFrame::Plain ); |
61 | 61 | ||
62 | if ( parent ) | 62 | if ( parent ) |
63 | setFocusProxy( parent ); | 63 | setFocusProxy( parent ); |
64 | else | 64 | else |
65 | setFocusPolicy( NoFocus ); | 65 | setFocusPolicy( NoFocus ); |
66 | 66 | ||
67 | setVScrollBarMode( Auto ); | 67 | setVScrollBarMode( Auto ); |
68 | setHScrollBarMode( AlwaysOff ); | 68 | setHScrollBarMode( AlwaysOff ); |
69 | 69 | ||
70 | connect( this, SIGNAL( doubleClicked( QListBoxItem * )), | 70 | connect( this, SIGNAL( doubleClicked(QListBoxItem*)), |
71 | SLOT( slotActivated( QListBoxItem * )) ); | 71 | SLOT( slotActivated(QListBoxItem*)) ); |
72 | 72 | ||
73 | // grmbl, just QListBox workarounds :[ Thanks Volker. | 73 | // grmbl, just QListBox workarounds :[ Thanks Volker. |
74 | connect( this, SIGNAL( currentChanged( QListBoxItem * )), | 74 | connect( this, SIGNAL( currentChanged(QListBoxItem*)), |
75 | SLOT( slotCurrentChanged() )); | 75 | SLOT( slotCurrentChanged() )); |
76 | connect( this, SIGNAL( clicked( QListBoxItem * )), | 76 | connect( this, SIGNAL( clicked(QListBoxItem*)), |
77 | SLOT( slotItemClicked( QListBoxItem * )) ); | 77 | SLOT( slotItemClicked(QListBoxItem*)) ); |
78 | } | 78 | } |
79 | 79 | ||
80 | OCompletionBox::~OCompletionBox() | 80 | OCompletionBox::~OCompletionBox() |
81 | { | 81 | { |
82 | d->m_parent = 0L; | 82 | d->m_parent = 0L; |
83 | delete d; | 83 | delete d; |
84 | } | 84 | } |
85 | 85 | ||
86 | QStringList OCompletionBox::items() const | 86 | QStringList OCompletionBox::items() const |
87 | { | 87 | { |
88 | QStringList list; | 88 | QStringList list; |
89 | for ( uint i = 0; i < count(); i++ ) { | 89 | for ( uint i = 0; i < count(); i++ ) { |
diff --git a/libopie2/qt3/opieui/ojanuswidget.cpp b/libopie2/qt3/opieui/ojanuswidget.cpp index 0a037ff..063e393 100644 --- a/libopie2/qt3/opieui/ojanuswidget.cpp +++ b/libopie2/qt3/opieui/ojanuswidget.cpp | |||
@@ -100,25 +100,25 @@ OJanusWidget::OJanusWidget( QWidget *parent, const char *name, int face ) | |||
100 | if( mFace == TreeList ) | 100 | if( mFace == TreeList ) |
101 | { | 101 | { |
102 | QSplitter *splitter = new QSplitter( this ); | 102 | QSplitter *splitter = new QSplitter( this ); |
103 | topLayout->addWidget( splitter, 10 ); | 103 | topLayout->addWidget( splitter, 10 ); |
104 | mTreeListResizeMode = QSplitter::KeepSize; | 104 | mTreeListResizeMode = QSplitter::KeepSize; |
105 | 105 | ||
106 | mTreeList = new QListView( splitter ); | 106 | mTreeList = new QListView( splitter ); |
107 | mTreeList->addColumn( QString::fromLatin1("") ); | 107 | mTreeList->addColumn( QString::fromLatin1("") ); |
108 | mTreeList->header()->hide(); | 108 | mTreeList->header()->hide(); |
109 | mTreeList->setRootIsDecorated(true); | 109 | mTreeList->setRootIsDecorated(true); |
110 | mTreeList->setSorting( -1 ); | 110 | mTreeList->setSorting( -1 ); |
111 | connect( mTreeList, SIGNAL(selectionChanged()), SLOT(slotShowPage()) ); | 111 | connect( mTreeList, SIGNAL(selectionChanged()), SLOT(slotShowPage()) ); |
112 | connect( mTreeList, SIGNAL(clicked(QListViewItem *)), SLOT(slotItemClicked(QListViewItem *))); | 112 | connect( mTreeList, SIGNAL(clicked(QListViewItem*)), SLOT(slotItemClicked(QListViewItem*))); |
113 | 113 | ||
114 | // | 114 | // |
115 | // Page area. Title at top with a separator below and a pagestack using | 115 | // Page area. Title at top with a separator below and a pagestack using |
116 | // all available space at bottom. | 116 | // all available space at bottom. |
117 | // | 117 | // |
118 | QFrame *p = new QFrame( splitter ); | 118 | QFrame *p = new QFrame( splitter ); |
119 | 119 | ||
120 | QHBoxLayout *hbox = new QHBoxLayout( p, 0, 0 ); | 120 | QHBoxLayout *hbox = new QHBoxLayout( p, 0, 0 ); |
121 | hbox->addSpacing( ODialog::spacingHint() ); | 121 | hbox->addSpacing( ODialog::spacingHint() ); |
122 | 122 | ||
123 | page = new QFrame( p ); | 123 | page = new QFrame( p ); |
124 | hbox->addWidget( page, 10 ); | 124 | hbox->addWidget( page, 10 ); |
@@ -150,26 +150,26 @@ OJanusWidget::OJanusWidget( QWidget *parent, const char *name, int face ) | |||
150 | mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "OJanusWidgetTitleLabel" ); | 150 | mTitleLabel = new QLabel( QString::fromLatin1("Empty page"), page, "OJanusWidgetTitleLabel" ); |
151 | vbox->addWidget( mTitleLabel ); | 151 | vbox->addWidget( mTitleLabel ); |
152 | 152 | ||
153 | QFont titleFont( mTitleLabel->font() ); | 153 | QFont titleFont( mTitleLabel->font() ); |
154 | titleFont.setBold( true ); | 154 | titleFont.setBold( true ); |
155 | mTitleLabel->setFont( titleFont ); | 155 | mTitleLabel->setFont( titleFont ); |
156 | 156 | ||
157 | mTitleSep = new OSeparator( page ); | 157 | mTitleSep = new OSeparator( page ); |
158 | mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain ); | 158 | mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain ); |
159 | vbox->addWidget( mTitleSep ); | 159 | vbox->addWidget( mTitleSep ); |
160 | 160 | ||
161 | mPageStack = new QWidgetStack( page ); | 161 | mPageStack = new QWidgetStack( page ); |
162 | connect(mPageStack, SIGNAL(aboutToShow(QWidget *)), | 162 | connect(mPageStack, SIGNAL(aboutToShow(QWidget*)), |
163 | this, SIGNAL(aboutToShowPage(QWidget *))); | 163 | this, SIGNAL(aboutToShowPage(QWidget*))); |
164 | vbox->addWidget( mPageStack, 10 ); | 164 | vbox->addWidget( mPageStack, 10 ); |
165 | } | 165 | } |
166 | else if( mFace == Tabbed ) | 166 | else if( mFace == Tabbed ) |
167 | { | 167 | { |
168 | mPageList = new QPtrList<QWidget>; | 168 | mPageList = new QPtrList<QWidget>; |
169 | 169 | ||
170 | mTabControl = new QTabWidget( this ); | 170 | mTabControl = new QTabWidget( this ); |
171 | mTabControl->setMargin (ODialog::marginHint()); | 171 | mTabControl->setMargin (ODialog::marginHint()); |
172 | topLayout->addWidget( mTabControl, 10 ); | 172 | topLayout->addWidget( mTabControl, 10 ); |
173 | } | 173 | } |
174 | else if( mFace == Swallow ) | 174 | else if( mFace == Swallow ) |
175 | { | 175 | { |
@@ -854,27 +854,27 @@ void OJanusWidget::setShowIconsInTreeList( bool state ) | |||
854 | void OJanusWidget::setRootIsDecorated( bool state ) | 854 | void OJanusWidget::setRootIsDecorated( bool state ) |
855 | { | 855 | { |
856 | if( mFace == TreeList ) { | 856 | if( mFace == TreeList ) { |
857 | mTreeList->setRootIsDecorated(state); | 857 | mTreeList->setRootIsDecorated(state); |
858 | } | 858 | } |
859 | } | 859 | } |
860 | 860 | ||
861 | void OJanusWidget::unfoldTreeList( bool persist ) | 861 | void OJanusWidget::unfoldTreeList( bool persist ) |
862 | { | 862 | { |
863 | if( mFace == TreeList ) | 863 | if( mFace == TreeList ) |
864 | { | 864 | { |
865 | if( persist ) | 865 | if( persist ) |
866 | connect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); | 866 | connect( mTreeList, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( slotReopen(QListViewItem*) ) ); |
867 | else | 867 | else |
868 | disconnect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); | 868 | disconnect( mTreeList, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( slotReopen(QListViewItem*) ) ); |
869 | 869 | ||
870 | for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) | 870 | for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) |
871 | item->setOpen( true ); | 871 | item->setOpen( true ); |
872 | } | 872 | } |
873 | } | 873 | } |
874 | 874 | ||
875 | void OJanusWidget::showEvent( QShowEvent * ) | 875 | void OJanusWidget::showEvent( QShowEvent * ) |
876 | { | 876 | { |
877 | if( mFace == TreeList ) | 877 | if( mFace == TreeList ) |
878 | { | 878 | { |
879 | QSplitter *splitter = (QSplitter*)(mTreeList->parentWidget()); | 879 | QSplitter *splitter = (QSplitter*)(mTreeList->parentWidget()); |
880 | splitter->setResizeMode( mTreeList, mTreeListResizeMode ); | 880 | splitter->setResizeMode( mTreeList, mTreeListResizeMode ); |
diff --git a/libopie2/qt3/opieui/olineedit.cpp b/libopie2/qt3/opieui/olineedit.cpp index 9cb0cff..6f66fc7 100644 --- a/libopie2/qt3/opieui/olineedit.cpp +++ b/libopie2/qt3/opieui/olineedit.cpp | |||
@@ -438,26 +438,26 @@ QPopupMenu *OLineEdit::createPopupMenu() | |||
438 | 438 | ||
439 | #if QT_VERSION > 290 | 439 | #if QT_VERSION > 290 |
440 | QPopupMenu *popup = QLineEdit::createPopupMenu(); | 440 | QPopupMenu *popup = QLineEdit::createPopupMenu(); |
441 | #else | 441 | #else |
442 | QPopupMenu *popup = new QPopupMenu(); | 442 | QPopupMenu *popup = new QPopupMenu(); |
443 | #warning OLineEdit is not fully functional on Qt2 | 443 | #warning OLineEdit is not fully functional on Qt2 |
444 | #endif | 444 | #endif |
445 | 445 | ||
446 | // completion object is present. | 446 | // completion object is present. |
447 | if ( compObj() ) | 447 | if ( compObj() ) |
448 | { | 448 | { |
449 | QPopupMenu *subMenu = new QPopupMenu( popup ); | 449 | QPopupMenu *subMenu = new QPopupMenu( popup ); |
450 | connect( subMenu, SIGNAL( activated( int ) ), | 450 | connect( subMenu, SIGNAL( activated(int) ), |
451 | this, SLOT( completionMenuActivated( int ) ) ); | 451 | this, SLOT( completionMenuActivated(int) ) ); |
452 | 452 | ||
453 | popup->insertSeparator(); | 453 | popup->insertSeparator(); |
454 | //popup->insertItem( SmallIconSet("completion"), i18n("Text Completion"), | 454 | //popup->insertItem( SmallIconSet("completion"), i18n("Text Completion"), |
455 | // subMenu ); | 455 | // subMenu ); |
456 | 456 | ||
457 | popup->insertItem( tr("Text Completion"), subMenu ); | 457 | popup->insertItem( tr("Text Completion"), subMenu ); |
458 | 458 | ||
459 | subMenu->insertItem( tr("None"), NoCompletion ); | 459 | subMenu->insertItem( tr("None"), NoCompletion ); |
460 | subMenu->insertItem( tr("Manual"), ShellCompletion ); | 460 | subMenu->insertItem( tr("Manual"), ShellCompletion ); |
461 | subMenu->insertItem( tr("Automatic"), AutoCompletion ); | 461 | subMenu->insertItem( tr("Automatic"), AutoCompletion ); |
462 | subMenu->insertItem( tr("Dropdown List"), PopupCompletion ); | 462 | subMenu->insertItem( tr("Dropdown List"), PopupCompletion ); |
463 | subMenu->insertItem( tr("Short Automatic"), SemiAutoCompletion ); | 463 | subMenu->insertItem( tr("Short Automatic"), SemiAutoCompletion ); |
@@ -607,35 +607,35 @@ bool OLineEdit::trapReturnKey() const | |||
607 | { | 607 | { |
608 | QLineEdit::setText( url.prettyURL() ); | 608 | QLineEdit::setText( url.prettyURL() ); |
609 | }*/ | 609 | }*/ |
610 | 610 | ||
611 | void OLineEdit::makeCompletionBox() | 611 | void OLineEdit::makeCompletionBox() |
612 | { | 612 | { |
613 | if ( d->completionBox ) | 613 | if ( d->completionBox ) |
614 | return; | 614 | return; |
615 | 615 | ||
616 | d->completionBox = new OCompletionBox( this, "completion box" ); | 616 | d->completionBox = new OCompletionBox( this, "completion box" ); |
617 | if ( handleSignals() ) | 617 | if ( handleSignals() ) |
618 | { | 618 | { |
619 | connect( d->completionBox, SIGNAL(highlighted( const QString& )), | 619 | connect( d->completionBox, SIGNAL(highlighted(const QString&)), |
620 | SLOT(setText( const QString& )) ); | 620 | SLOT(setText(const QString&)) ); |
621 | connect( d->completionBox, SIGNAL(userCancelled( const QString& )), | 621 | connect( d->completionBox, SIGNAL(userCancelled(const QString&)), |
622 | SLOT(setText( const QString& )) ); | 622 | SLOT(setText(const QString&)) ); |
623 | 623 | ||
624 | // Nice lil' hacklet ;) KComboBox doesn't know when the completionbox | 624 | // Nice lil' hacklet ;) KComboBox doesn't know when the completionbox |
625 | // is created (childEvent() is even more hacky, IMHO), so we simply | 625 | // is created (childEvent() is even more hacky, IMHO), so we simply |
626 | // forward the completionbox' activated signal from here. | 626 | // forward the completionbox' activated signal from here. |
627 | if ( parentWidget() && parentWidget()->inherits("KComboBox") ) | 627 | if ( parentWidget() && parentWidget()->inherits("KComboBox") ) |
628 | connect( d->completionBox, SIGNAL( activated( const QString& )), | 628 | connect( d->completionBox, SIGNAL( activated(const QString&)), |
629 | parentWidget(), SIGNAL( activated( const QString & ))); | 629 | parentWidget(), SIGNAL( activated(const QString&))); |
630 | } | 630 | } |
631 | } | 631 | } |
632 | 632 | ||
633 | /*bool OLineEdit::overrideAccel (const QKeyEvent* e) | 633 | /*bool OLineEdit::overrideAccel (const QKeyEvent* e) |
634 | { | 634 | { |
635 | KShortcut scKey; | 635 | KShortcut scKey; |
636 | 636 | ||
637 | KKey key( e ); | 637 | KKey key( e ); |
638 | KeyBindingMap keys = getKeyBindings(); | 638 | KeyBindingMap keys = getKeyBindings(); |
639 | 639 | ||
640 | if (keys[TextCompletion].isNull()) | 640 | if (keys[TextCompletion].isNull()) |
641 | scKey = KStdAccel::shortcut(KStdAccel::TextCompletion); | 641 | scKey = KStdAccel::shortcut(KStdAccel::TextCompletion); |
@@ -697,30 +697,30 @@ void OLineEdit::setCompletedItems( const QStringList& items ) | |||
697 | OCompletionBox * OLineEdit::completionBox( bool create ) | 697 | OCompletionBox * OLineEdit::completionBox( bool create ) |
698 | { | 698 | { |
699 | if ( create ) | 699 | if ( create ) |
700 | makeCompletionBox(); | 700 | makeCompletionBox(); |
701 | 701 | ||
702 | return d->completionBox; | 702 | return d->completionBox; |
703 | } | 703 | } |
704 | 704 | ||
705 | void OLineEdit::setCompletionObject( OCompletion* comp, bool hsig ) | 705 | void OLineEdit::setCompletionObject( OCompletion* comp, bool hsig ) |
706 | { | 706 | { |
707 | OCompletion *oldComp = compObj(); | 707 | OCompletion *oldComp = compObj(); |
708 | if ( oldComp && handleSignals() ) | 708 | if ( oldComp && handleSignals() ) |
709 | disconnect( oldComp, SIGNAL( matches( const QStringList& )), | 709 | disconnect( oldComp, SIGNAL( matches(const QStringList&)), |
710 | this, SLOT( setCompletedItems( const QStringList& ))); | 710 | this, SLOT( setCompletedItems(const QStringList&))); |
711 | 711 | ||
712 | if ( comp && hsig ) | 712 | if ( comp && hsig ) |
713 | connect( comp, SIGNAL( matches( const QStringList& )), | 713 | connect( comp, SIGNAL( matches(const QStringList&)), |
714 | this, SLOT( setCompletedItems( const QStringList& ))); | 714 | this, SLOT( setCompletedItems(const QStringList&))); |
715 | 715 | ||
716 | OCompletionBase::setCompletionObject( comp, hsig ); | 716 | OCompletionBase::setCompletionObject( comp, hsig ); |
717 | } | 717 | } |
718 | 718 | ||
719 | // QWidget::create() turns off mouse-Tracking which would break auto-hiding | 719 | // QWidget::create() turns off mouse-Tracking which would break auto-hiding |
720 | void OLineEdit::create( WId id, bool initializeWindow, bool destroyOldWindow ) | 720 | void OLineEdit::create( WId id, bool initializeWindow, bool destroyOldWindow ) |
721 | { | 721 | { |
722 | QLineEdit::create( id, initializeWindow, destroyOldWindow ); | 722 | QLineEdit::create( id, initializeWindow, destroyOldWindow ); |
723 | //OCursor::setAutoHideCursor( this, true, true ); | 723 | //OCursor::setAutoHideCursor( this, true, true ); |
724 | } | 724 | } |
725 | 725 | ||
726 | void OLineEdit::clear() | 726 | void OLineEdit::clear() |