4 * John Levon, moz@compsoc.man.ac.uk
7 /***************************************************************************
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
14 ***************************************************************************/
19 #include "dlg/helpers.h"
21 #ifdef CXX_WORKING_NAMESPACES
22 using kde_helpers::setSizeHint;
25 UrlDialog::UrlDialog(FormUrl *form, QWidget *parent, const char *name, bool, WFlags)
26 : QWidget(parent,name,0), form_(form)
32 url = new QLineEdit(this);
35 urlname = new QLineEdit(this);
38 labelurl = new QLabel(this);
39 labelurl->setText(_("Url :"));
40 labelurl->setMargin(5);
41 setSizeHint(labelurl);
42 labelurl->setMaximumSize(labelurl->sizeHint());
44 labelurlname = new QLabel(this);
45 labelurlname->setText(_("Name :"));
46 labelurlname->setMargin(5);
47 setSizeHint(labelurlname);
48 labelurlname->setMaximumSize(labelurlname->sizeHint());
50 htmlurl = new QCheckBox(this);
51 htmlurl->setText(_("Generate hyperlink"));
53 htmlurl->setMaximumSize(htmlurl->sizeHint());
55 buttonOk = new QPushButton(this);
56 setSizeHint(buttonOk);
57 buttonOk->setMaximumSize(buttonOk->sizeHint());
58 buttonOk->setText(_("&OK"));
59 buttonOk->setDefault(true);
61 buttonCancel = new QPushButton(this);
62 setSizeHint(buttonCancel);
63 buttonCancel->setMaximumSize(buttonCancel->sizeHint());
64 buttonCancel->setText(_("&Cancel"));
68 QToolTip::add(labelurl,_("URL"));
69 QToolTip::add(url,_("URL"));
70 QToolTip::add(labelurlname,_("Name associated with the URL"));
71 QToolTip::add(urlname,_("Name associated with the URL"));
72 QToolTip::add(htmlurl,_("Output as a hyperlink ?"));
76 topLayout = new QHBoxLayout(this,10);
78 layout = new QVBoxLayout();
79 topLayout->addLayout(layout);
80 layout->addSpacing(10);
82 urlLayout = new QHBoxLayout();
83 layout->addLayout(urlLayout);
84 urlLayout->addWidget(labelurl, 0);
85 urlLayout->addWidget(url, 1);
87 urlnameLayout = new QHBoxLayout();
88 layout->addLayout(urlnameLayout);
89 urlnameLayout->addWidget(labelurlname, 0);
90 urlnameLayout->addWidget(urlname, 1);
92 htmlurlLayout = new QHBoxLayout();
93 layout->addStretch(1);
94 layout->addLayout(htmlurlLayout);
95 layout->addStretch(1);
96 htmlurlLayout->addWidget(htmlurl);
97 htmlurlLayout->addStretch(1);
99 buttonLayout = new QHBoxLayout();
100 layout->addLayout(buttonLayout);
101 buttonLayout->addStretch(1);
102 buttonLayout->addWidget(buttonOk, 1);
103 buttonLayout->addStretch(2);
104 buttonLayout->addWidget(buttonCancel, 1);
105 buttonLayout->addStretch(1);
109 connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply_adaptor()));
110 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close_adaptor()));
115 UrlDialog::~UrlDialog()
119 void UrlDialog::closeEvent(QCloseEvent *e)