move BookmarkInfoWidget def into .h

svn path=/trunk/kdebase/konqueror/keditbookmarks/; revision=230558
This commit is contained in:
Alexander Kellett 2003-06-09 11:49:25 +00:00
parent 24272ada25
commit a9a97e3cc6
2 changed files with 47 additions and 38 deletions

View file

@ -21,8 +21,8 @@
#include <qclipboard.h>
#include <qsplitter.h>
#include <qlayout.h>
#include <qlabel.h>
#include <klocale.h>
#include <kdebug.h>
@ -240,46 +240,39 @@ QString CurrentMgr::correctAddress(const QString &address) {
KEBApp *KEBApp::s_topLevel = 0;
#include <qlabel.h>
class BookmarkInfoWidget : public QWidget {
public:
BookmarkInfoWidget(QWidget * parent = 0, const char * name = 0)
: QWidget (parent, name) {
QBoxLayout *vbox = new QVBoxLayout(this);
QGridLayout *grid = new QGridLayout( vbox, 3, 4 );
void BookmarkInfoWidget::showBookmark(const KBookmark &bk) {
m_title_le->setText(bk.text());
m_url_le->setText(bk.url().url());
m_comment_le->setText("a comment");
m_moddate_le->setText("the modification date");
m_credate_le->setText("the creation date");
}
m_title_le = new KLineEdit( this );
grid->addWidget( m_title_le, 0, 1 );
grid->addWidget( new QLabel( m_title_le, i18n( "Name:" ), this ), 0, 0 );
BookmarkInfoWidget::BookmarkInfoWidget(QWidget * parent, const char * name)
: QWidget (parent, name) {
QBoxLayout *vbox = new QVBoxLayout(this);
QGridLayout *grid = new QGridLayout( vbox, 3, 4 );
m_url_le = new KLineEdit( this );
grid->addWidget( m_url_le, 1, 1 );
grid->addWidget( new QLabel( m_url_le, i18n( "Location:" ), this ), 1, 0 );
m_title_le = new KLineEdit( this );
grid->addWidget( m_title_le, 0, 1 );
grid->addWidget( new QLabel( m_title_le, i18n( "Name:" ), this ), 0, 0 );
m_comment_le = new KLineEdit( this );
grid->addWidget( m_comment_le, 2, 1 );
grid->addWidget( new QLabel( m_comment_le, i18n( "Comment:" ), this ), 2, 0 );
m_url_le = new KLineEdit( this );
grid->addWidget( m_url_le, 1, 1 );
grid->addWidget( new QLabel( m_url_le, i18n( "Location:" ), this ), 1, 0 );
m_moddate_le = new KLineEdit( this );
grid->addWidget( m_moddate_le, 0, 3 );
grid->addWidget( new QLabel( m_moddate_le, i18n( "First viewed:" ), this ), 0, 2 );
m_comment_le = new KLineEdit( this );
grid->addWidget( m_comment_le, 2, 1 );
grid->addWidget( new QLabel( m_comment_le, i18n( "Comment:" ), this ), 2, 0 );
m_credate_le = new KLineEdit( this );
grid->addWidget( m_credate_le, 1, 3 );
grid->addWidget( new QLabel( m_credate_le, i18n( "Viewed last:" ), this ), 1, 2 );
}
public:
void showBookmark(const KBookmark &bk) {
m_title_le->setText(bk.text());
m_url_le->setText(bk.url().url());
m_comment_le->setText("a comment");
m_moddate_le->setText("the modification date");
m_credate_le->setText("the creation date");
}
private:
KLineEdit *m_title_le, *m_url_le, *m_comment_le, *m_moddate_le, *m_credate_le;
KBookmark m_bk;
};
m_moddate_le = new KLineEdit( this );
grid->addWidget( m_moddate_le, 0, 3 );
grid->addWidget( new QLabel( m_moddate_le, i18n( "First viewed:" ), this ), 0, 2 );
m_credate_le = new KLineEdit( this );
grid->addWidget( m_credate_le, 1, 3 );
grid->addWidget( new QLabel( m_credate_le, i18n( "Viewed last:" ), this ), 1, 2 );
}
KEBApp::KEBApp(const QString & bookmarksFile, bool readonly, const QString &address)
: KMainWindow(), m_dcopIface(0) {
@ -302,9 +295,10 @@ KEBApp::KEBApp(const QString & bookmarksFile, bool readonly, const QString &addr
ListView::self()->initListViews();
ListView::self()->setInitialAddress(address);
BookmarkInfoWidget *bkinfo = new BookmarkInfoWidget(vsplitter);
m_bkinfo = new BookmarkInfoWidget(vsplitter);
vsplitter->setOrientation(QSplitter::Vertical);
vsplitter->setSizes(QValueList<int>() << h << 380 << bkinfo->sizeHint().height() );
vsplitter->setSizes(QValueList<int>() << h << 380 << m_bkinfo->sizeHint().height() );
setCentralWidget(vsplitter);
resize(ListView::self()->widget()->sizeHint().width(), vsplitter->sizeHint().height());

View file

@ -22,6 +22,7 @@
#include <kmainwindow.h>
#include <kcommand.h>
#include <kbookmark.h>
class KBookmarkManager;
class KToggleAction;
@ -85,6 +86,16 @@ private:
static CurrentMgr *s_mgr;
};
class BookmarkInfoWidget : public QWidget {
public:
BookmarkInfoWidget(QWidget * = 0, const char * = 0);
public:
void showBookmark(const KBookmark &bk);
private:
KLineEdit *m_title_le, *m_url_le, *m_comment_le, *m_moddate_le, *m_credate_le;
KBookmark m_bk;
};
class KEBApp : public KMainWindow
{
Q_OBJECT
@ -114,6 +125,8 @@ public:
bool modified() { return m_modified; }
bool nsShown();
BookmarkInfoWidget *bkInfo() { return m_bkinfo; }
private:
static KBookmarkManager* bookmarkManager();
@ -154,6 +167,8 @@ private:
bool m_advancedAddBookmark;
static KEBApp *s_topLevel;
BookmarkInfoWidget *m_bkinfo;
};
#endif