summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-28 17:12:43 (UTC)
committer zautrix <zautrix>2005-10-28 17:12:43 (UTC)
commit16e87ac5b81352c51343715cf1080191aaba9611 (patch) (side-by-side diff)
treeba64a88d20259728559af64e8def62179775c104
parentd6eb485cf2ff7a14918f51a5b21b5306f9908fdb (diff)
downloadkdepimpi-16e87ac5b81352c51343715cf1080191aaba9611.zip
kdepimpi-16e87ac5b81352c51343715cf1080191aaba9611.tar.gz
kdepimpi-16e87ac5b81352c51343715cf1080191aaba9611.tar.bz2
ff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/phoneeditwidget.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp
index f52cedb..7e2aec1 100644
--- a/kaddressbook/phoneeditwidget.cpp
+++ b/kaddressbook/phoneeditwidget.cpp
@@ -12,93 +12,100 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qlayout.h>
#include <qlabel.h>
#include <qtooltip.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qstring.h>
#include <qlistbox.h>
#include <qlistview.h>
#include <qbuttongroup.h>
#include <qhbox.h>
#include <qcursor.h>
#include <qtimer.h>
+#include <qapplication.h>
#include <kbuttonbox.h>
#include <klistview.h>
#include <kapplication.h>
#include <qapplication.h>
#include <kconfig.h>
#include <klineedit.h>
#include <kcombobox.h>
#include <klocale.h>
#include <kdebug.h>
#include <kglobal.h>
#include <kiconloader.h>
#include <kabc/phonenumber.h>
#include "typecombo.h"
#include "phoneeditwidget.h"
PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
: QWidget(parent,name)
{
QGridLayout* gridLayout = new QGridLayout ( this, 2,2 );
QLabel *temp = new QLabel( "", this );
temp->setAlignment( Qt::AlignCenter );
temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
- gridLayout->addWidget( temp, 1, 0 );
QPushButton *addBut = new QPushButton ( "add", this );
addBut->setPixmap ( SmallIcon("plus"));
addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() );
connect(addBut,SIGNAL(clicked ()),SLOT(addNumber()));
- gridLayout->addWidget( addBut, 0, 0 );
sv = new QScrollView( this );
sv->setFrameStyle ( QFrame::Panel | QFrame::Plain );
sv->setLineWidth ( 1 );
sv->setMidLineWidth ( 1 );
mw = new QWidget ( sv->viewport() );
sv->addChild(mw);
sv->setResizePolicy( QScrollView::AutoOneFit );
mainLayout = new QVBoxLayout ( mw );
mainLayout->setMargin( 0 );
mainLayout->setSpacing( 0 );
+ if ( QApplication::desktop()->width() == 240 || QApplication::desktop()->width() == 480 ) {
+ gridLayout->addWidget( addBut, 0, 0 );
+ gridLayout->addWidget( temp, 0, 1 );
+ gridLayout->addMultiCellWidget( sv, 1,1 , 0,1 );
+ } else {
+ gridLayout->addWidget( temp, 1, 0 );
+ gridLayout->addWidget( addBut, 0, 0 );
gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 );
+ }
setDefaults();
mTypeNumberEditList.setAutoDelete( true );
mPopup = new QPopupMenu( this );
QStringList list = PhoneNumber::supportedTypeListNames();
mPopupCount = list.count();
int i = 0;
while ( i < mPopupCount ) {
mPopup->insertItem( list[ i ], i );
++i;
}
connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int)));
}
PhoneEditWidget::~PhoneEditWidget()
{
}
void PhoneEditWidget::setDefaults()
{
mTypeNumberEditList.clear();
PhoneTypeNumberEdit* edit = appendEditCombo();
KABC::PhoneNumber phoneNumber;
phoneNumber.setType( KABC::PhoneNumber::Home | KABC::PhoneNumber::Pref );
edit->setPhoneNumber( phoneNumber );