Exemplo n.º 1
0
SearchDialog::SearchDialog()
{
    SET_WNDPROC("search")
    setIcon(Pict("find"));
    setButtonsPict(this);
    setCaption(i18n("Search"));
    m_current = NULL;
    m_currentResult = NULL;
    m_bAdd = true;
    m_id		= 0;
    m_result_id = 0;
    m_active	= NULL;
    m_search	= new SearchBase(this);
    m_update = new QTimer(this);
    connect(m_update, SIGNAL(timeout()), this, SLOT(update()));
    setCentralWidget(m_search);
    m_status = statusBar();
    m_result = NULL;
    setAdd(false);
    m_search->btnOptions->setIconSet(Icon("1downarrow"));
    m_search->btnAdd->setIconSet(Icon("add"));
    m_search->btnNew->setIconSet(Icon("new"));
    connect(m_search->wndCondition, SIGNAL(aboutToShow(QWidget*)), this, SLOT(aboutToShow(QWidget*)));
    connect(m_search->wndResult, SIGNAL(aboutToShow(QWidget*)), this, SLOT(resultShow(QWidget*)));
    fillClients();
    connect(m_search->cmbClients, SIGNAL(activated(int)), this, SLOT(clientActivated(int)));
    m_result = new ListView(m_search->wndResult);
    m_result->addColumn(i18n("Results"));
    m_result->setShowSortIndicator(true);
    m_result->setExpandingColumn(0);
    m_result->setFrameShadow(QFrame::Sunken);
    m_result->setLineWidth(1);
    addResult(m_result);
    showResult(NULL);
    aboutToShow(m_search->wndCondition->visibleWidget());
    connect(m_search->btnSearch, SIGNAL(clicked()), this, SLOT(searchClick()));
    m_search->cmbClients->setFocus();
    connect(m_search->btnOptions, SIGNAL(clicked()), this, SLOT(optionsClick()));
    connect(m_search->btnAdd, SIGNAL(clicked()), this, SLOT(addClick()));
    m_search->btnOptions->setEnabled(false);
    m_search->btnAdd->setEnabled(false);
    connect(m_result, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
    connect(m_result, SIGNAL(dragStart()), this, SLOT(dragStart()));
    connect(m_search->btnNew, SIGNAL(clicked()), this, SLOT(newSearch()));
    m_result->setMenu(MenuSearchItem);
    resultShow(m_result);
}
Exemplo n.º 2
0
MainWindow::MainWindow(QtSession* session) : session_(session)
{
  QWidget* centralWidget = new QWidget;
  searchEdit_ = new QLineEdit;
  connect(searchEdit_, SIGNAL(returnPressed()), SLOT(searchClick()));

  QHBoxLayout* hLayout = new QHBoxLayout;

  vLayout_ = new QVBoxLayout;
  vLayout_->addWidget(searchEdit_);
  vLayout_->addLayout(hLayout);

  hLayout->addWidget(new LibraryWidget(session_));
  hLayout->addWidget(new PlaylistWidget);

  centralWidget->setLayout(vLayout_);
  setCentralWidget(centralWidget);
}