/** Initializes this object. */
void CSearchDialog::initView() {
    namespace DU = util::directory;

    QVBoxLayout* verticalLayout = new QVBoxLayout(this);
    setLayout(verticalLayout);

    m_searchOptionsArea = new BtSearchOptionsArea(this);
    verticalLayout->addWidget(m_searchOptionsArea);

    m_searchResultArea = new BtSearchResultArea(this);
    verticalLayout->addWidget(m_searchResultArea);

    QHBoxLayout* horizontalLayout = new QHBoxLayout();

    m_analyseButton = new QPushButton(tr("&Analyze results..."), 0);
    m_analyseButton->setToolTip(tr("Show a graphical analysis of the search result"));
    QSpacerItem* spacerItem = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);
    horizontalLayout->addWidget(m_analyseButton);
    horizontalLayout->addItem(spacerItem);

    m_closeButton = new QPushButton(this);
    m_closeButton->setText(tr("&Close"));
    m_closeButton->setIcon(DU::getIcon(CResMgr::searchdialog::close_icon));
    horizontalLayout->addWidget(m_closeButton);

    verticalLayout->addLayout(horizontalLayout);

    loadDialogSettings();
}
BtModuleManagerDialog::BtModuleManagerDialog(QWidget* parent)
        : BtConfigDialog(parent) {
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowTitle(tr("Bookshelf Manager"));

    // Install page
    BtInstallPage* installPage = new BtInstallPage();
    addPage(installPage);

    //Uninstall page
    BtRemovePage* removePage = new BtRemovePage();
    addPage(removePage);

    //Index page
    BtIndexPage* indexPage = new BtIndexPage();
    addPage(indexPage);

    slotChangePage(0);

    // Dialog button (Close)
    QDialogButtonBox* bbox = new QDialogButtonBox(this);
    bbox->addButton(QDialogButtonBox::Close);
    util::prepareDialogBox(bbox);
    addButtonBox(bbox);
    connect(bbox, SIGNAL(rejected()), SLOT(close()));

    loadDialogSettings();
}
CConfigurationDialog::CConfigurationDialog(QWidget * parent, BtActionCollection* actionCollection )
	: BtConfigDialog(parent),
	  m_actionCollection(actionCollection),
	  m_displayPage(0),
	  m_swordPage(0),
	  m_acceleratorsPage(0),
	  m_languagesPage(0),
	  m_bbox(0)
{
	setWindowTitle(tr("Configure BibleTime"));
	setAttribute(Qt::WA_DeleteOnClose);
	
	// Add "Display" page
	m_displayPage = new CDisplaySettingsPage(this);
	addPage(m_displayPage);

	// Add "Desk" (sword) page
	m_swordPage = new CSwordSettingsPage(this);
	addPage(m_swordPage);

	// Add "Languages" (fonts) page
	m_languagesPage = new CLanguageSettingsPage(this);
	addPage(m_languagesPage);

//	// Add "Keyboard" (accelerators) page
//	m_acceleratorsPage = new CAcceleratorSettingsPage(this);
//	KPageWidgetItem* accelPage = new KPageWidgetItem(m_acceleratorsPage);
//	accelPage->setHeader( tr( "HotKeys" ) );
//	accelPage->setName( tr( "HotKeys" ) );
//	accelPage->setIcon( KIcon(util::filesystem::DirectoryUtil::getIcon(CResMgr::settings::keys::icon)) );
//	addPage(accelPage);

	// Dialog buttons
	m_bbox = new QDialogButtonBox(this);
	m_bbox->addButton(QDialogButtonBox::Ok);
	m_bbox->addButton(QDialogButtonBox::Apply);
	m_bbox->addButton(QDialogButtonBox::Cancel);
	util::prepareDialogBox(m_bbox);
	addButtonBox(m_bbox);
	bool ok = connect(m_bbox, SIGNAL(clicked(QAbstractButton *)), SLOT(slotButtonClicked(QAbstractButton *)));
	Q_ASSERT(ok);

	loadDialogSettings();

	slotChangePage(0);
}
Example #4
0
void MainWindow::createCentralWidget()
{
    mWebView = new EnView(this);
    mWebView->setContextMenuPolicy(Qt::NoContextMenu);
    if(isFirstRun)
        mWebView->setHtml(defaultPage(false));
    else
        mWebView->setHtml(defaultPage(true));

    connect(mWebView, SIGNAL(noteClicked(QString)), &mEnExport, SLOT(openNote(QString)));
    //connect(mWebView, SIGNAL(linkClicked(QUrl)), SLOT(openUrl(QUrl)));

    QPalette navigationPalette;
    navigationPalette.setColor(QPalette::Window, QColor(mBgColor));

    mToolBar = new QToolBar(this);
    addToolBar(Qt::TopToolBarArea, mToolBar);
    mToolBar->setBackgroundRole(QPalette::Window);
    mToolBar->setAutoFillBackground(true);
    mToolBar->setPalette(navigationPalette);
    mToolBar->setMovable(false);
    mToolBar->setIconSize(QSize(30, 30));

    //mPageNumberLabel = new QLabel("4 / 7", this);
    //mPageNumberLabel->setFont(QFont("Times", 18));

    QAction* settingsAction = new QAction(QIcon(":/images/gear2.png"), tr("Settings"), mToolBar);
    QAction* prevAction = new QAction(QIcon(":/images/prev.png"), tr("Prev"), mToolBar);
    QAction* nextAction = new QAction(QIcon(":/images/next.png"), tr("Next"), mToolBar);

    mToolBar->addAction(settingsAction);
    mToolBar->addAction(prevAction);
    mToolBar->addAction(nextAction);

    mNavigationLabel = new QLabel(mToolBar);
    mNavigationLabel->setFont(QFont("Times", 18));
    mToolBar->addWidget(mNavigationLabel);

    connect(settingsAction, SIGNAL(triggered()), SLOT(loadDialogSettings()));
    //connect(settingsAction, SIGNAL(triggered()), mDialog, SLOT(show()));
    connect(prevAction, SIGNAL(triggered()), SLOT(prevNote()));
    connect(nextAction, SIGNAL(triggered()), SLOT(nextNote()));

    setCentralWidget(mWebView);
}