-rw-r--r-- | kabc/addresseedialog.cpp | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 34f4160..b3429e3 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <qgroupbox.h> | 23 | #include <qgroupbox.h> |
24 | #include <qapplication.h> | 24 | #include <qapplication.h> |
25 | #include <qregexp.h> | 25 | #include <qregexp.h> |
26 | #include <qvbox.h> | ||
27 | #include <qlabel.h> | ||
26 | 28 | ||
27 | #include <klocale.h> | 29 | #include <klocale.h> |
28 | #include <kdebug.h> | 30 | #include <kdebug.h> |
@@ -31,6 +33,7 @@ | |||
31 | #include "stdaddressbook.h" | 33 | #include "stdaddressbook.h" |
32 | 34 | ||
33 | #include "addresseedialog.h" | 35 | #include "addresseedialog.h" |
36 | #include "KDGanttMinimizeSplitter.h" | ||
34 | //#include "addresseedialog.moc" | 37 | //#include "addresseedialog.moc" |
35 | 38 | ||
36 | using namespace KABC; | 39 | using namespace KABC; |
@@ -59,15 +62,24 @@ QString AddresseeItem::key( int column, bool ) const | |||
59 | 62 | ||
60 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | 63 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : |
61 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), | 64 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), |
62 | Ok|Cancel, Ok, parent ), mMultiple( multiple ) | 65 | Ok|Cancel, No, parent ), mMultiple( multiple ) |
63 | { | 66 | { |
64 | QWidget *topWidget = plainPage(); | 67 | QWidget *topWidget = plainPage(); |
65 | 68 | ||
66 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); | 69 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); |
67 | QBoxLayout *listLayout = new QVBoxLayout; | ||
68 | topLayout->addLayout( listLayout ); | ||
69 | 70 | ||
70 | mAddresseeList = new KListView( topWidget ); | 71 | |
72 | KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); | ||
73 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | ||
74 | |||
75 | topLayout->addWidget(mMiniSplitter ); | ||
76 | |||
77 | QWidget *listWidget = new QWidget( mMiniSplitter ); | ||
78 | |||
79 | QBoxLayout *listLayout = new QVBoxLayout (listWidget) ; | ||
80 | //topLayout->addLayout( listLayout ); | ||
81 | |||
82 | mAddresseeList = new KListView( listWidget ); | ||
71 | mAddresseeList->addColumn( i18n("Name") ); | 83 | mAddresseeList->addColumn( i18n("Name") ); |
72 | mAddresseeList->addColumn( i18n("Email") ); | 84 | mAddresseeList->addColumn( i18n("Email") ); |
73 | mAddresseeList->setAllColumnsShowFocus( true ); | 85 | mAddresseeList->setAllColumnsShowFocus( true ); |
@@ -76,7 +88,7 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | |||
76 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), | 88 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), |
77 | SLOT( slotOk() ) ); | 89 | SLOT( slotOk() ) ); |
78 | 90 | ||
79 | mAddresseeEdit = new QLineEdit( topWidget ); | 91 | mAddresseeEdit = new QLineEdit( listWidget ); |
80 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), | 92 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), |
81 | SLOT( loadAddressBook() ) ); | 93 | SLOT( loadAddressBook() ) ); |
82 | mAddresseeEdit->setFocus(); | 94 | mAddresseeEdit->setFocus(); |
@@ -84,13 +96,13 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | |||
84 | listLayout->addWidget( mAddresseeEdit ); | 96 | listLayout->addWidget( mAddresseeEdit ); |
85 | 97 | ||
86 | if ( mMultiple ) { | 98 | if ( mMultiple ) { |
87 | QBoxLayout *selectedLayout = new QVBoxLayout; | 99 | //QBoxLayout *selectedLayout = new QVBoxLayout; |
88 | topLayout->addLayout( selectedLayout ); | 100 | //topLayout->addLayout( selectedLayout ); |
89 | topLayout->setSpacing( spacingHint() ); | 101 | //topLayout->setSpacing( spacingHint() ); |
90 | 102 | ||
91 | QGroupBox *selectedGroup = new QGroupBox( 1, Horizontal, i18n("Selected"), | 103 | QVBox *selectedGroup = new QVBox( mMiniSplitter ); |
92 | topWidget ); | 104 | new QLabel ( i18n("Selected:"), selectedGroup ); |
93 | selectedLayout->addWidget( selectedGroup ); | 105 | //selectedLayout->addWidget( selectedGroup ); |
94 | 106 | ||
95 | mSelectedList = new KListView( selectedGroup ); | 107 | mSelectedList = new KListView( selectedGroup ); |
96 | mSelectedList->addColumn( i18n("Name") ); | 108 | mSelectedList->addColumn( i18n("Name") ); |
@@ -117,6 +129,10 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | |||
117 | SLOT( addressBookChanged() ) ); | 129 | SLOT( addressBookChanged() ) ); |
118 | 130 | ||
119 | loadAddressBook(); | 131 | loadAddressBook(); |
132 | QValueList<int> splitterSize; | ||
133 | splitterSize.append( ( width() / 5 ) * 3 ); | ||
134 | splitterSize.append( ( width() / 5 ) *2 ); | ||
135 | mMiniSplitter->setSizes( splitterSize ); | ||
120 | } | 136 | } |
121 | 137 | ||
122 | AddresseeDialog::~AddresseeDialog() | 138 | AddresseeDialog::~AddresseeDialog() |