Beispiel #1
0
void
AmazonStore::polish()
{
    DEBUG_BLOCK;

    if( !m_polished ) {
        m_polished = true;

        initTopPanel();
        initBottomPanel();
        initView();

        connect( m_itemView, SIGNAL(itemSelected(QModelIndex)), this, SLOT(itemSelected(QModelIndex)) );
        connect( m_itemView, SIGNAL(itemDoubleClicked(QModelIndex)), this, SLOT(itemDoubleClicked(QModelIndex)) );
        connect( m_itemView, SIGNAL(searchForAlbum(QModelIndex)), this, SLOT(searchForAlbum(QModelIndex)) );

        m_amazonInfoParser = new AmazonInfoParser();
        setInfoParser( m_amazonInfoParser );
        m_amazonInfoParser->showFrontPage();

        AmazonUrlRunner *runner = new AmazonUrlRunner();
        connect( runner, SIGNAL(search(QString)), this, SLOT(newSearchRequest(QString)) );
        The::amarokUrlHandler()->registerRunner( runner, runner->command() );
    }
}
Beispiel #2
0
FileBrowser::FileBrowser(QWidget *parent)
{
    Q_UNUSED(parent);

    this->CreateDialogLayout();
    connect(lstDir, SIGNAL(itemDoubleClicked()), this, SLOT(onLstDirDoubleClick()));
    connect(lstFile, SIGNAL(itemDoubleClicked()), this, SLOT(onLstFileDoubleClick()));
    connect(btnCancel, SIGNAL(pressed()), this, SLOT(onCancelPressed()));
    connect(txtFilename, SIGNAL(textEdited(const QString &)), this, SLOT(onFilenameChanged()));
    connect(txtFilename, SIGNAL(returnPressed()), this, SLOT(onAcceptPressed()));
    connect(cmbFilter, SIGNAL(activated(int)), this, SLOT(onFilterActivated(int)));
    connect(btnHome, SIGNAL(pressed()), this, SLOT(onHomePressed()));
    connect(btnMachine, SIGNAL(pressed()), this, SLOT(onMachinePressed()));
    connect(btnRemote, SIGNAL(pressed()), this, SLOT(onRemotePressed()));
    connect(btnAccessGrid, SIGNAL(pressed()), this, SLOT(onAccessGridPressed()));
    connect(cmbDirectory, SIGNAL(activated(int)), this, SLOT(onDirActivated(int)));
    connect(btnDirUp, SIGNAL(pressed()), this, SLOT(onDirUpPressed()));
    connect(cmbHistory, SIGNAL(activated(int)), this, SLOT(onHistoryActivated(int)));
    connect(btnAccept, SIGNAL(pressed()), this, SLOT(onAcceptPressed()));
    connect(this, SIGNAL(requestLists(QString, QString)), this->mTUIElement, SLOT(handleRequestLists(QString, QString)));
    connect(this, SIGNAL(filterChange(QString)), this->mTUIElement, SLOT(handleFilterUpdate(QString)));
    connect(this, SIGNAL(dirChange(QString)), this->mTUIElement, SLOT(handleDirChange(QString)));
    connect(this, SIGNAL(requestClients()), this->mTUIElement, SLOT(handleClientRequest()));
    connect(this, SIGNAL(locationChanged(QString)), this->mTUIElement, SLOT(handleLocationChange(QString)));
    connect(this, SIGNAL(requestLocalHome()), this->mTUIElement, SLOT(handleLocalHome()));
    connect(this, SIGNAL(reqDriveList()), this->mTUIElement, SLOT(handleReqDriveList()));
    connect(this, SIGNAL(fileSelected(QString, QString, bool)), this->mTUIElement, SLOT(sendSelectedFile(QString, QString, bool)));

    this->mLocationPath = "";
    this->mFilename = new QStringList();
    mRCDialog = new Ui_RemoteClients();
    mRCDialog->setupUi(mRCDialog);
    this->mMode = FileBrowser::OPEN;
}
Beispiel #3
0
void DirectoryView::mouseDoubleClickEvent(QMouseEvent* event)
{
	QModelIndex index = indexAt(event->pos());
	DirectoryItem* item = model()->indexToItem(index);
	if(item)
		emit itemDoubleClicked(item);
}
bool QtFileIconView::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setDirectory((const QString&)static_QUType_QString.get(_o+1)); break;
    case 1: setDirectory((const QDir&)*((const QDir*)static_QUType_ptr.get(_o+1))); break;
    case 2: newDirectory(); break;
    case 3: currentDir(); break;
    case 4: itemDoubleClicked((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 5: slotDropped((QDropEvent*)static_QUType_ptr.get(_o+1),(const QValueList<QIconDragItem>&)*((const QValueList<QIconDragItem>*)static_QUType_ptr.get(_o+2))); break;
    case 6: viewLarge(); break;
    case 7: viewSmall(); break;
    case 8: viewBottom(); break;
    case 9: viewRight(); break;
    case 10: flowEast(); break;
    case 11: flowSouth(); break;
    case 12: itemTextTruncate(); break;
    case 13: itemTextWordWrap(); break;
    case 14: sortAscending(); break;
    case 15: sortDescending(); break;
    case 16: arrangeItemsInGrid(); break;
    case 17: slotRightPressed((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 18: openFolder(); break;
    default:
	return QIconView::qt_invoke( _id, _o );
    }
    return TRUE;
}
Beispiel #5
0
void ListView::checkDoubleClick(const QModelIndex &idx)
{
    if (!TreeView::getForceSingleClick() && idx.model() && idx.model()->rowCount(idx)) {
        return;
    }
    emit itemDoubleClicked(idx);
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    lastDrawnShapeType = None;

    buttonCheckStates.append(ui->bDrawLine);
    buttonCheckStates.append(ui->bDrawRectangle);
    buttonCheckStates.append(ui->bDrawEllipse);
    buttonCheckStates.append(ui->bTriangle);

    ui->tabWidget->removeTab(0);
    ui->tabWidget->removeTab(0);

    ui->rShowName->setChecked(true);
    ui->rHideName->setChecked(false);

    connect(ui->bPenColor, SIGNAL(released()), this, SLOT(buttonPenColorAction()));
    connect(ui->bDrawLine, SIGNAL(released()), this, SLOT(buttonLineAction()));
    connect(ui->bDrawRectangle, SIGNAL(released()), this, SLOT(buttonRectAction()));
    connect(ui->bDrawEllipse, SIGNAL(released()), this, SLOT(buttonEllipseAction()));
    connect(ui->bPenWidth, SIGNAL(released()), this, SLOT(buttonPenWidthAction()));
    connect(ui->bTriangle, SIGNAL(released()), this, SLOT(buttonTriangleAction()));
    connect(ui->bFill, SIGNAL(released()), this, SLOT(buttonFill()));
    connect(ui->rShowName, SIGNAL(clicked(bool)), this, SLOT(showNames()));
    connect(ui->rHideName, SIGNAL(clicked(bool)), this, SLOT(hideNames()));
    connect(ui->listWidget, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(itemDoubleClicked(QModelIndex)));
    connect(ui->listWidget, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
    connect(ui->actionShow_List_View, SIGNAL(triggered(bool)), this, SLOT(showTableList()));
    connect(ui->action_Hide_List_View, SIGNAL(triggered(bool)), this, SLOT(hideTableList()));
}
Beispiel #7
0
//将行号为row的设置为播放项
void PlaylistWindow::setItemPlay(int row)
{
	if (row == -1) return;
	int cnt = playlist->mediaCount();
    QListWidgetItem *item = listWidget->item(row);
	emit itemDoubleClicked(item, doubleClicked);
	doubleClicked = true;
    this->setItemPlayView(item);
    qDebug("setItemPlay %d",row);
}
bool Workspace::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0:
        update();
        break;
    case 1:
        update((FormFile*)static_QUType_ptr.get(_o+1));
        break;
    case 2:
        activeFormChanged((FormWindow*)static_QUType_ptr.get(_o+1));
        break;
    case 3:
        activeEditorChanged((SourceEditor*)static_QUType_ptr.get(_o+1));
        break;
    case 4:
        itemClicked((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3)));
        break;
    case 5:
        itemDoubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1));
        break;
    case 6:
        rmbClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)));
        break;
    case 7:
        bufferChosen((const QString&)static_QUType_QString.get(_o+1));
        break;
    case 8:
        projectDestroyed((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 9:
        sourceFileAdded((SourceFile*)static_QUType_ptr.get(_o+1));
        break;
    case 10:
        sourceFileRemoved((SourceFile*)static_QUType_ptr.get(_o+1));
        break;
    case 11:
        formFileAdded((FormFile*)static_QUType_ptr.get(_o+1));
        break;
    case 12:
        formFileRemoved((FormFile*)static_QUType_ptr.get(_o+1));
        break;
    case 13:
        objectAdded((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 14:
        objectRemoved((QObject*)static_QUType_ptr.get(_o+1));
        break;
    default:
        return QListView::qt_invoke( _id, _o );
    }
    return TRUE;
}
bool FuelInitDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: contextMenuActivated((int)static_QUType_int.get(_o+1)); break;
    case 1: rightButtonClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 2: itemDoubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 3: store(); break;
    default:
	return AppDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
Beispiel #10
0
void
TableView::mouseDoubleClickEvent(QMouseEvent* e)
{
    QModelIndex index = indexAt( e->pos() );
    TableItem* item = _imp->model->item(index);

    if (item) {
        setCurrentIndex(index);
        Q_EMIT itemDoubleClicked(item);
    }
    QTreeView::mouseDoubleClickEvent(e);
}
void  OgreWidget::mouseDoubleClickEvent(QMouseEvent * e)
{
  if (e->button() == Qt::LeftButton)
    {
      emit itemDoubleClicked();
      e->accept();
    }
  else
    {
      e->ignore();
    }
}
Beispiel #12
0
 void TOPPASTreeView::keyPressEvent(QKeyEvent * e)
 {
   QTreeWidget::keyPressEvent(e);
   if (currentItem() && e->key() == Qt::Key_Return)
   {
     e->accept();
     emit itemDoubleClicked(currentItem(), 0);
   }
   else
   {
     e->ignore();
   }
 }
int _finddefinition::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QListWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: itemDoubleClicked((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        }
        _id -= 1;
    }
    return _id;
}
Beispiel #14
0
MessageList::MessageList(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MessageList)
{
    ui->setupUi(this);

    m_model = new MessageModel(this);
    ui->list->setModel(m_model);
//    ui->list->setItemDelegate( new MessageDelegate(ui->list));

    connect(ui->list, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(itemDoubleClicked(QModelIndex)));
    connect(ui->list->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(itemActivated(QModelIndex, QModelIndex)));
}
void AutoCompleteListWidget::keyPressEvent (QKeyEvent* event)
{
	std::cout << event->text().toStdString() << std::endl;
	std::cout << event->key() << std::endl;

	std::cout << Qt::Key_Return << std::endl;


	if (event->key() == 16777220)
	{
		std::cout << "auto complete item selected" << std::endl;
		event->accept();
//		QTextCursor c2 = m_editor->textCursor();
//		close();

		QList<QListWidgetItem*> selectedItems = this->selectedItems();

		if (!selectedItems.empty())
		{
			emit itemDoubleClicked(selectedItems.first());
		}
		return;
	}
	else if (event->key() == Qt::Key_Backspace )
	{
		event->accept();
		QTextCursor c2 = m_editor->textCursor();
		c2.deleteChar();
	}
	else if (event->key() == Qt::Key_Space)
	{
		QTextCursor c2 = m_editor->textCursor();
		c2.insertText(event->text());
		this->parentWidget()->setFocus();
		this->close();
		event->accept();
	}
	else if (event->key() == Qt::Key_Escape)
	{
		this->parentWidget()->setFocus();
		this->close();
		event->accept();
	}
	else if (event->text().isSimpleText())
	{
		QTextCursor c2 = m_editor->textCursor();
		c2.insertText(event->text());
	}

	QListWidget::keyPressEvent(event);
}
Beispiel #16
0
SearchTab::SearchTab(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SearchTab)
{
    QSettings settings("Entomologist");
    QString lastQuery = settings.value("last-search-query", "").toString();

    ui->setupUi(this);
    mSearchCount = 0;
    pSpinnerMovie = new QMovie(this);
    pSpinnerMovie->setFileName(":/spinner");
    pSpinnerMovie->setScaledSize(QSize(48,48));
    ui->spinnerLabel->setMovie(pSpinnerMovie);
    ui->searchSpinnerWidget->hide();

    if (lastQuery.isEmpty())
    {
        ui->searchQuery->setPlaceholderText(tr("Search summaries and comments"));
    }
    else
    {
        ui->searchQuery->setText(lastQuery);
        ui->searchQuery->setCursorPosition(lastQuery.size());
    }

    ui->trackerCombo->addItem("All Trackers");

    pModel = new SqlSearchModel(this);
    pModel->setTable("search_results");
    pModel->select();
    SqlSearchDelegate *delegate = new SqlSearchDelegate();
    ui->tableView->setItemDelegate(delegate);
    ui->tableView->setModel(pModel);
    pModel->setHeaderData(1, Qt::Horizontal, tr("Tracker"));
    pModel->setHeaderData(2, Qt::Horizontal, tr("Bug ID"));
    pModel->setHeaderData(3, Qt::Horizontal, tr("Summary"));
    ui->tableView->setSortingEnabled(true);
    ui->tableView->setGridStyle(Qt::PenStyle(Qt::DotLine));
    ui->tableView->hideColumn(0); // Hide the internal row id
    ui->tableView->verticalHeader()->hide(); // Hide the Row numbers
    ui->tableView->resizeColumnsToContents();
    ui->tableView->resizeRowsToContents();
    ui->tableView->setAlternatingRowColors(true);
    connect(ui->searchButton, SIGNAL(clicked()),
            this, SLOT(searchButtonClicked()));
    connect(ui->searchQuery, SIGNAL(returnPressed()),
            this, SLOT(searchButtonClicked()));
    connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)),
            this, SLOT(itemDoubleClicked(QModelIndex)));
}
void MusicVideoTableWidget::listCellClicked(int row, int col)
{
    MusicQueryTableWidget::listCellClicked(row, col);
    switch(col)
    {
        case 5:
        case 6:
            itemDoubleClicked(row, 999);
            break;
        case 7:
            musicDownloadLocal(row);
            break;
        default:break;
    }
}
Beispiel #18
0
//---------------------------------------------------------
//   insertKey()
//!  inserts a new key in the list and starts the editor for it
//---------------------------------------------------------
void LMaster::insertKey()
      {
      LMasterKeyEventItem* lastKey = (LMasterKeyEventItem*) getLastOfType(LMASTER_KEYEVENT);

      //QString beatString = ((LMasterLViewItem*)lastKey)->text(LMASTER_BEAT_COL); DELETETHIS
      //int m, b, t;
      //Pos p = Pos(beatString);
      //p.mbt(&m, &b, &t);
      //m++; //Next bar

      int newTick = MusEGlobal::song->cpos();
      new LMasterKeyEventItem(view, MusECore::KeyEvent(lastKey->key(), newTick));
      QTreeWidgetItem* newKeyItem = view->topLevelItem(0);

      editingNewItem = true; // State
      editorColumn = LMASTER_VAL_COL; // Set that we edit editorColumn
      view->clearSelection();
      view->setCurrentItem(newKeyItem);
      itemDoubleClicked(newKeyItem);
      }
Beispiel #19
0
//---------------------------------------------------------
//   timeSigButtonClicked()
//!  inserts a new sig-item in the list and starts the editor for it
//---------------------------------------------------------
void LMaster::timeSigButtonClicked()
      {
      LMasterSigEventItem* lastSig = (LMasterSigEventItem*) getLastOfType(LMASTER_SIGEVENT);
//      QString beatString = ((LMasterLViewItem*)lastSig)->text(LMASTER_BEAT_COL); DELETETHIS
//      int m, b, t;
//      Pos p = Pos(beatString);
//      p.mbt(&m, &b, &t);
//      m++;
//      int newTick = MusEGlobal::sigmap.bar2tick(m, b, t);
      int newTick = MusEGlobal::song->cpos();
      MusECore::SigEvent* ev = new MusECore::SigEvent(MusECore::TimeSignature(lastSig->z(), lastSig->n()), newTick);
      new LMasterSigEventItem(view, ev);
      QTreeWidgetItem* newSigItem = view->topLevelItem(0);

      editingNewItem = true; // State
      editorColumn = LMASTER_VAL_COL; // Set that we edit editorColumn
      view->clearSelection();
      view->setCurrentItem(newSigItem);
      itemDoubleClicked(newSigItem);
      }
Beispiel #20
0
//---------------------------------------------------------
//   tempoButtonClicked()
//!  inserts a new tempo-item in the list and starts the editor for it
//---------------------------------------------------------
void LMaster::tempoButtonClicked()
      {
      LMasterTempoItem* lastTempo = (LMasterTempoItem*) getLastOfType(LMASTER_TEMPO);
//      QString beatString = ((LMasterLViewItem*)lastTempo)->text(LMASTER_BEAT_COL); DELETETHIS?
//      int m, b, t;
//      Pos p = Pos(beatString);
//      p.mbt(&m, &b, &t);
//      m++; //Next bar
//      int newTick = MusEGlobal::sigmap.bar2tick(m, b, t);
      int newTick = MusEGlobal::song->cpos();
      MusECore::TEvent* ev = new MusECore::TEvent(lastTempo->tempo(), newTick);
      new LMasterTempoItem(view, ev);
      QTreeWidgetItem* newTempoItem = view->topLevelItem(0);

      editingNewItem = true; // State
      editorColumn = LMASTER_VAL_COL; // Set that we edit editorColumn
      view->clearSelection();
      view->setCurrentItem(newTempoItem);
      itemDoubleClicked(newTempoItem);
      }
Beispiel #21
0
int dUserWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: searchWidgetUpdate(); break;
        case 1: closed(); break;
        case 2: minimized(); break;
        case 3: show(); break;
        case 4: viewBarToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 5: viewIconToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 6: viewListToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 7: viewTableToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 8: refreshTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 9: refreshTriggered(); break;
        case 10: refreshInfoTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 11: refreshInfoTriggered(); break;
        case 12: userInfoTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 13: userInfoTriggered(); break;
        case 14: sendBeepTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 15: sendBeepTriggered(); break;
        case 16: sendMessageTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 17: sendMessageTriggered(); break;
        case 18: sendMassTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 19: sendMassTriggered(); break;
        case 20: sendPersonalMassTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 21: sendPersonalMassTriggered(); break;
        case 22: customContextMenuRequested(*reinterpret_cast< QPoint*>(_a[1])); break;
        case 23: searchTextChanged(*reinterpret_cast< QString*>(_a[1])); break;
        case 24: countUserChange(*reinterpret_cast< int*>(_a[1])); break;
        case 25: splitterMoved(*reinterpret_cast< int*>(_a[1]),*reinterpret_cast< int*>(_a[2])); break;
        case 26: tableHeaderResize(*reinterpret_cast< int*>(_a[1]),*reinterpret_cast< int*>(_a[2]),*reinterpret_cast< int*>(_a[3])); break;
        case 27: itemDoubleClicked(*reinterpret_cast< QModelIndex*>(_a[1])); break;
        }
        _id -= 28;
    }
    return _id;
}
Beispiel #22
0
void LMaster::cmd(int cmd)
      {
      switch(cmd) {
            case CMD_DELETE: {
                  LMasterLViewItem* l = (LMasterLViewItem*) view->currentItem();
                  if (!l)
                     return;
                  // Delete item:
                  if (l->tick() != 0) {
                        if (l == view->topLevelItem(view->topLevelItemCount() - 1))
                              view->setCurrentItem(view->itemAbove(l));
                        else
                              view->setCurrentItem(view->itemBelow(l));

                        switch (l->getType()) {
                              case LMASTER_TEMPO:
                                    {
                                    LMasterTempoItem* t = (LMasterTempoItem*) l;
                                    MusEGlobal::song->applyOperation(MusECore::UndoOp(MusECore::UndoOp::DeleteTempo,
                                         t->tick(), t->tempo()));
                                    break;
                                    }
                              case LMASTER_SIGEVENT:
                                    {
                                    LMasterSigEventItem* s = (LMasterSigEventItem*) l;
                                    MusEGlobal::song->applyOperation(MusECore::UndoOp(MusECore::UndoOp::DeleteSig,
                                                    s->tick(), s->z(), s->n()));
                                    break;
                                    }
                              case LMASTER_KEYEVENT:
                                    {
                                    LMasterKeyEventItem* k = (LMasterKeyEventItem*) l;
                                    MusEGlobal::song->applyOperation(MusECore::UndoOp(MusECore::UndoOp::DeleteKey,
                                              k->tick(), k->key()));
                                    break;
                                    }
                              default:
                                    M_ERROR("Default switch statement reached");
                                    break;
                              }
                        }
                  break;
                  }
            case CMD_INSERT_TEMPO:
                  tempoButtonClicked();
                  break;
            case CMD_INSERT_SIG:
                  timeSigButtonClicked();
                  break;
            case CMD_INSERT_KEY:
                  insertKey();
                  break;
            case CMD_EDIT_BEAT:
            case CMD_EDIT_VALUE:
                  cmd == CMD_EDIT_VALUE ? editorColumn = LMASTER_VAL_COL : editorColumn = LMASTER_BEAT_COL;
                  if (view->currentItem() && !editedItem) {
                        itemDoubleClicked(view->currentItem());
                        }
                  break;
            }
      }
Beispiel #23
0
void Project::slotOnDoubleClicked(const QString& item, const QString& category)
{
    emit itemDoubleClicked(QFileInfo(m_libraryFileName).absolutePath() + "/" + item + ".xsch");
}
Beispiel #24
0
void Project::slotAddToProject()
{
    if(projectLibrary) {
        AddToProjectDialog *p = new AddToProjectDialog(this);

        if(p->accepted()) {
            if(p->userChoice() == Qucs::ExistingComponent) {

                QString fileName = QFileDialog::getOpenFileName(this, tr("Add File to Project"),
                                                                "", tr("Component-xml (*.xsch)"));
                if(!fileName.isEmpty()) {

                    //First we copy the selected file to current project folder
                    if(QFile::copy(fileName, QFileInfo(m_libraryFileName).absolutePath() + "/" + QFileInfo(fileName).fileName())) {
                        fileName = QFileInfo(m_libraryFileName).absolutePath() + "/" + QFileInfo(fileName).fileName();
                    }
                    else {
                        QMessageBox::critical(this, tr("Error"),
                                tr("Component %1 already exists in project!").arg(QFileInfo(fileName).baseName()));
                        return;
                    }

                    //We generate the corresponding symbol
                    QucsView *view = new SchematicView(0, this);
                    view->toSchematicView()->schematicScene()->setMode(Qucs::SymbolMode);

                    if(!view->load(fileName)) {
                        QMessageBox::critical(this, tr("Error"),
                                              tr("Could not open file!"));

                        QFile::remove(fileName);
                        return;
                    }

                    fileName.replace(".xsch",".xsym");
                    view->setFileName(fileName);
                    XmlSymbolFormat *symbol = new XmlSymbolFormat(view->toSchematicView()->schematicScene());
                    symbol->save();

                    //Now we load the new component in the library
                    projectLibrary->parseExternalComponent(fileName);
                    projectLibrary->saveLibrary();
                    m_projectsSidebar->unPlugLibrary(m_libraryName, "root");
                    m_projectsSidebar->plugLibrary(m_libraryName, "root");

                    //Finally we open the component
                    fileName.replace(".xsym",".xsch");
                    emit itemDoubleClicked(fileName);
                }
            }
            else if(p->userChoice() == Qucs::NewComponent) {
                QString fileName = QFileInfo(m_libraryFileName).absolutePath() + "/" + p->fileName()+".xsch";

                QucsView *view = new SchematicView(0, this);
                view->setFileName(fileName);

                //When the component is already created, we return.
                if(QFileInfo(fileName).exists()) {
                    QMessageBox::critical(this, tr("Error"),
                            tr("Component already created!"));
                    return;
                }

                if(!view->save()) {
                    QMessageBox::critical(this, tr("Error"),
                            tr("Could not save file!"));
                    delete view;
                    return;
                }

                emit itemDoubleClicked(fileName);

                view->toSchematicView()->schematicScene()->setMode(Qucs::SymbolMode);

                fileName.replace(".xsch",".xsym");
                view->setFileName(fileName);
                XmlSymbolFormat *symbol = new XmlSymbolFormat(view->toSchematicView()->schematicScene());
                symbol->save();

                delete view;

                projectLibrary->parseExternalComponent(fileName);
                projectLibrary->saveLibrary();
                m_projectsSidebar->unPlugLibrary(m_libraryName, "root");
                m_projectsSidebar->plugLibrary(m_libraryName, "root");
            }
            else {
                //TODO in case of adding a component from another project, we
                //should copy the component as well as all its dependencies.
            }
        }
    }
    else {
        QMessageBox::critical(this, tr("Error"),
                tr("Invalid project!"));
        return;
    }
}
int QListWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QListView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: itemPressed((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        case 1: itemClicked((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        case 2: itemDoubleClicked((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        case 3: itemActivated((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        case 4: itemEntered((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        case 5: itemChanged((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        case 6: currentItemChanged((*reinterpret_cast< QListWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QListWidgetItem*(*)>(_a[2]))); break;
        case 7: currentTextChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 8: currentRowChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 9: itemSelectionChanged(); break;
        case 10: scrollToItem((*reinterpret_cast< const QListWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QAbstractItemView::ScrollHint(*)>(_a[2]))); break;
        case 11: scrollToItem((*reinterpret_cast< const QListWidgetItem*(*)>(_a[1]))); break;
        case 12: clear(); break;
        case 13: d_func()->_q_emitItemPressed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 14: d_func()->_q_emitItemClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 15: d_func()->_q_emitItemDoubleClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 16: d_func()->_q_emitItemActivated((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 17: d_func()->_q_emitItemEntered((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 18: d_func()->_q_emitItemChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 19: d_func()->_q_emitCurrentItemChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 20: d_func()->_q_sort(); break;
        case 21: d_func()->_q_dataChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 22;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = count(); break;
        case 1: *reinterpret_cast< int*>(_v) = currentRow(); break;
        case 2: *reinterpret_cast< bool*>(_v) = isSortingEnabled(); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 1: setCurrentRow(*reinterpret_cast< int*>(_v)); break;
        case 2: setSortingEnabled(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 3;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #26
0
void SettingsGUI::init() {
    {   //Basic tab
        WulforUtil *WU = WulforUtil::getInstance();
        QStringList styles = QStyleFactory::keys();

        comboBox_THEMES->addItem(tr("Default (need to restart)"));

        for (const QString &s : styles)
            comboBox_THEMES->addItem(s);

        comboBox_THEMES->setCurrentIndex(styles.indexOf(WSGET(WS_APP_THEME)) >= 0? (styles.indexOf(WSGET(WS_APP_THEME))+1) : 0);


        if (WSGET(WS_APP_FONT).isEmpty()) {
            lineEdit_APPFONT->setText(qApp->font().toString());
            WSSET(WS_APP_FONT, qApp->font().toString());
        }
        else
            lineEdit_APPFONT->setText(WSGET(WS_APP_FONT));

        int i = 0;
        int k = -1;
#if !defined(Q_OS_WIN)
        QDir translationsDir(CLIENT_TRANSLATIONS_DIR);
#else
        QDir translationsDir(qApp->applicationDirPath()+QDir::separator()+CLIENT_TRANSLATIONS_DIR);
#endif
        QMap<QString, QString> langNames;
        langNames["en.qm"]       = tr("English");
        langNames["ru.qm"]       = tr("Russian");
        langNames["be.qm"]       = tr("Belarusian");
        langNames["hu.qm"]       = tr("Hungarian");
        langNames["fr.qm"]       = tr("French");
        langNames["pl.qm"]       = tr("Polish");
        langNames["pt_BR.qm"]    = tr("Portuguese (Brazil)");
        langNames["sr.qm"]       = tr("Serbian (Cyrillic)");
        langNames["*****@*****.**"] = tr("Serbian (Latin)");
        langNames["uk.qm"]       = tr("Ukrainian");
        langNames["es.qm"]       = tr("Spanish");
        langNames["eu.qm"]       = tr("Basque");
        langNames["bg.qm"]       = tr("Bulgarian");
        langNames["sk.qm"]       = tr("Slovak");
        langNames["cs.qm"]       = tr("Czech");
        langNames["de.qm"]       = tr("German");
        langNames["el.qm"]       = tr("Greek");
        langNames["it.qm"]       = tr("Italian");
        langNames["vi.qm"]       = tr("Vietnamese");
        langNames["zh_CN.qm"]    = tr("Chinese (China)");
        langNames["sv_SE.qm"]    = tr("Swedish (Sweden)");

        QString full_path;
        QString lang;

        for (const auto &f : translationsDir.entryList(QDir::Files | QDir::NoSymLinks)) {
            full_path = QDir::toNativeSeparators( translationsDir.filePath(f) );
            lang = langNames[f];

            if (!lang.isEmpty()) {
                comboBox_LANGS->addItem(lang, full_path);

                if (WSGET(WS_TRANSLATION_FILE).endsWith(f))
                    k = i;

                i++;
            }
        }
        comboBox_LANGS->setCurrentIndex(k);

#if !defined(Q_OS_WIN)
        QString users = CLIENT_ICONS_DIR "/user/";
#else
        QString users = qApp->applicationDirPath()+QDir::separator()+CLIENT_ICONS_DIR "/user/";
#endif
        i = 0;
        k = -1;
        for (const QString &f : QDir(users).entryList(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot)) {
            if (!f.isEmpty()) {
                comboBox_USERS->addItem(f);

                if (f == WSGET(WS_APP_USERTHEME))
                    k = i;

                i++;
            }
        }
        comboBox_USERS->setCurrentIndex(k);

#if !defined(Q_OS_WIN)
        QString icons = CLIENT_ICONS_DIR "/appl/";
#else
        QString icons = qApp->applicationDirPath()+QDir::separator()+CLIENT_ICONS_DIR "/appl/";
#endif
        i = 0;
        k = -1;
        for (const QString &f : QDir(icons).entryList(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot)) {
            if (!f.isEmpty()) {
                comboBox_ICONS->addItem(f);

                if (f == WSGET(WS_APP_ICONTHEME))
                    k = i;

                i++;
            }
        }
        comboBox_ICONS->setCurrentIndex(k);

#if !defined(Q_OS_WIN)
        QString emot = CLIENT_DATA_DIR "/emoticons/";
#else
        QString emot = qApp->applicationDirPath()+QDir::separator()+CLIENT_DATA_DIR "/emoticons/";
#endif
        comboBox_EMOT->setCurrentIndex(0);
        i = 0;
        for (const QString &f : QDir(emot).entryList(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot)) {
            if (!f.isEmpty()) {
                comboBox_EMOT->addItem(f);

                if (f == WSGET(WS_APP_EMOTICON_THEME))
                    comboBox_EMOT->setCurrentIndex(i);

                i++;
            }
        }

        lineEdit_LANGFILE->setText(WSGET(WS_TRANSLATION_FILE));

        toolButton_LANGBROWSE->setIcon(WU->getPixmap(WulforUtil::eiFOLDER_BLUE));

        if (WBGET(WB_MAINWINDOW_REMEMBER))
            radioButton_REMEMBER->setChecked(true);
        else if (WBGET(WB_MAINWINDOW_HIDE))
            radioButton_HIDE->setChecked(true);
        else
            radioButton_SHOW->setChecked(true);

        groupBox_TRAY->setChecked(WBGET(WB_TRAY_ENABLED));
        groupBox_TRAY->setEnabled(QSystemTrayIcon::isSystemTrayAvailable());

        if (WBGET(WB_MAINWINDOW_USE_SIDEBAR))
            comboBox_TABBAR->setCurrentIndex(2);
        else if (WBGET(WB_MAINWINDOW_USE_M_TABBAR))
            comboBox_TABBAR->setCurrentIndex(1);
        else
            comboBox_TABBAR->setCurrentIndex(0);

#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
        checkBox_ICONTHEME->setChecked(WBGET("app/use-icon-theme", false));
#endif
        checkBox_HIDE_ICONS_IN_MENU->setChecked(WBGET("mainwindow/dont-show-icons-in-menus", false));

        // Hide options which do not work in Mac OS X, MS Windows or Haiku:
#if defined (Q_OS_WIN) || defined (__HAIKU__)
        checkBox_ICONTHEME->hide();
#elif defined(Q_OS_MAC)
        checkBox_ICONTHEME->hide();
        groupBox_TRAY->hide();
#endif
    }
    {   //Chat tab
        checkBox_CHATJOINS->setChecked(WBGET(WB_CHAT_SHOW_JOINS));
        checkBox_JOINSFAV->setChecked(WBGET(WB_CHAT_SHOW_JOINS_FAV));
        checkBox_CHATHIDDEN->setChecked(WBGET(WB_SHOW_HIDDEN_USERS));
        checkBox_IGNOREPMHUB->setChecked(BOOLSETTING(IGNORE_HUB_PMS));
        checkBox_IGNOREPMBOT->setChecked(BOOLSETTING(IGNORE_BOT_PMS));
        checkBox_REDIRECTPMBOT->setChecked(WBGET(WB_CHAT_REDIRECT_BOT_PMS));
        checkBox_REDIRECT_UNREAD->setChecked(WBGET("hubframe/redirect-pm-to-main-chat", false));
        checkBox_KEEPFOCUS->setChecked(WBGET(WB_CHAT_KEEPFOCUS));
        checkBox_UNREADEN_DRAW_LINE->setChecked(WBGET("hubframe/unreaden-draw-line", true));
        checkBox_USE_CTRL_ENTER->setChecked(WBGET(WB_USE_CTRL_ENTER));
        checkBox_ROTATING->setChecked(WBGET(WB_CHAT_ROTATING_MSGS));
        checkBox_EMOT->setChecked(WBGET(WB_APP_ENABLE_EMOTICON));
        checkBox_EMOTFORCE->setChecked(WBGET(WB_APP_FORCE_EMOTICONS));
        checkBox_SMILEPANEL->setChecked(WBGET(WB_CHAT_USE_SMILE_PANEL));
        checkBox_HIDESMILEPANEL->setChecked(WBGET(WB_CHAT_HIDE_SMILE_PANEL));
    }
    {   //Chat (extended) tab
        comboBox_DBL_CLICK->setCurrentIndex(WIGET(WI_CHAT_DBLCLICK_ACT));
        comboBox_MDL_CLICK->setCurrentIndex(WIGET(WI_CHAT_MDLCLICK_ACT));
        comboBox_DEF_MAGNET_ACTION->setCurrentIndex(WIGET(WI_DEF_MAGNET_ACTION));
        comboBox_APP_UNIT_BASE->setCurrentIndex(SETTING(APP_UNIT_BASE));
        checkBox_HIGHLIGHTFAVS->setChecked(WBGET(WB_CHAT_HIGHLIGHT_FAVS));
        checkBox_CHAT_SHOW_IP->setChecked(BOOLSETTING(USE_IP));
        checkBox_CHAT_SHOW_CC->setChecked(BOOLSETTING(GET_USER_COUNTRY));
        checkBox_BB_CODE->setChecked(WBGET("hubframe/use-bb-code", false));
        lineEdit_TIMESTAMP->setText(WSGET(WS_CHAT_TIMESTAMP));

        spinBox_OUT_IN_HIST->setValue(WIGET(WI_OUT_IN_HIST));
        spinBox_PARAGRAPHS->setValue(WIGET(WI_CHAT_MAXPARAGRAPHS));

        comboBox_CHAT_SEPARATOR->setCurrentIndex(comboBox_CHAT_SEPARATOR->findText(WSGET(WS_CHAT_SEPARATOR)));
    }
    {   //Color tab
        QColor c;
        QPixmap p(10, 10);

        c.setNamedColor(WSGET(WS_CHAT_LOCAL_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Local user"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_OP_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Operator"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_BOT_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Bot"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_PRIV_LOCAL_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Private: local user"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_PRIV_USER_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Private: user"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_SAY_NICK));
        p.fill(c);
        new QListWidgetItem(p, tr("Chat: Say nick"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_STAT_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Status"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_USER_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("User"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_FAVUSER_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Favorite User"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_TIME_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Time stamp"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_MSG_COLOR));
        p.fill(c);
        new QListWidgetItem(p, tr("Message"), listWidget_CHATCOLOR);

        c.setNamedColor(WSGET(WS_CHAT_FIND_COLOR));
        h_color = c;

        c.setAlpha(WIGET(WI_CHAT_FIND_COLOR_ALPHA));
        p.fill(c);
        toolButton_H_COLOR->setIcon(p);

        c.setNamedColor(WSGET(WS_APP_SHARED_FILES_COLOR));
        shared_files_color = c;
        c.setAlpha(WIGET(WI_APP_SHARED_FILES_ALPHA));
        p.fill(c);
        toolButton_SHAREDFILES->setIcon(p);

        downloads_clr = qvariant_cast<QColor>(WVGET("transferview/download-bar-color", QColor()));
        uploads_clr = qvariant_cast<QColor>(WVGET("transferview/upload-bar-color", QColor()));

        if (downloads_clr.isValid()) {
            c = downloads_clr;
            p.fill(c);

            toolButton_DOWNLOADSCLR->setIcon(p);
        }
        if (uploads_clr.isValid()) {
            c = uploads_clr;
            p.fill(c);

            toolButton_UPLOADSCLR->setIcon(p);
        }

        checkBox_CHAT_BACKGROUND_COLOR->setChecked(WBGET("hubframe/change-chat-background-color", false));
        toolButton_CHAT_BACKGROUND_COLOR->setEnabled(WBGET("hubframe/change-chat-background-color", false));
        if (!WSGET("hubframe/chat-background-color", "").isEmpty()) {
            c.setNamedColor(WSGET("hubframe/chat-background-color"));
            chat_background_color = c;
            c.setAlpha(255);
            p.fill(c);
            toolButton_CHAT_BACKGROUND_COLOR->setIcon(p);
        }

        horizontalSlider_H_COLOR->setValue(WIGET(WI_CHAT_FIND_COLOR_ALPHA));
        horizontalSlider_SHAREDFILES->setValue(WIGET(WI_APP_SHARED_FILES_ALPHA));
    }
    {   // Fonts tab
        CustomFontModel *model = new CustomFontModel(this);
        tableView->setModel(model);

        tableView->horizontalHeader()->restoreState(QByteArray::fromBase64(WSGET(WS_SETTINGS_GUI_FONTS_STATE).toUtf8()));

        connect(tableView, SIGNAL(doubleClicked(QModelIndex)), model, SLOT(itemDoubleClicked(QModelIndex)));
        connect(this, SIGNAL(saveFonts()), model, SLOT(ok()));
    }

    connect(pushButton_TEST, SIGNAL(clicked()), this, SLOT(slotTestAppTheme()));
    connect(comboBox_THEMES, SIGNAL(activated(int)), this, SLOT(slotThemeChanged()));
    connect(listWidget_CHATCOLOR, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(slotChatColorItemClicked(QListWidgetItem*)));
    connect(toolButton_APPFONTBROWSE, SIGNAL(clicked()), this, SLOT(slotBrowseFont()));
    connect(toolButton_LANGBROWSE, SIGNAL(clicked()), this, SLOT(slotBrowseLng()));
    connect(comboBox_LANGS, SIGNAL(activated(int)), this, SLOT(slotLngIndexChanged(int)));
    connect(comboBox_USERS, SIGNAL(activated(int)), this, SLOT(slotUsersChanged()));
    connect(comboBox_ICONS, SIGNAL(activated(int)), this, SLOT(slotIconsChanged()));
    connect(toolButton_H_COLOR, SIGNAL(clicked()), this, SLOT(slotGetColor()));
    connect(toolButton_SHAREDFILES, SIGNAL(clicked()), this, SLOT(slotGetColor()));
    connect(toolButton_CHAT_BACKGROUND_COLOR, SIGNAL(clicked()), this, SLOT(slotGetColor()));
    connect(toolButton_DOWNLOADSCLR, SIGNAL(clicked()), this, SLOT(slotGetColor()));
    connect(toolButton_UPLOADSCLR, SIGNAL(clicked()), this, SLOT(slotGetColor()));
    connect(pushButton_RESET, SIGNAL(clicked()), this, SLOT(slotResetTransferColors()));
    connect(horizontalSlider_H_COLOR, SIGNAL(valueChanged(int)), this, SLOT(slotSetTransparency(int)));
    connect(horizontalSlider_SHAREDFILES, SIGNAL(valueChanged(int)), this, SLOT(slotSetTransparency(int)));
}
void EditCalendarsPage::editClicked()
{
    if (m_calendarList->currentItem())
        itemDoubleClicked(m_calendarList->currentItem());
}
Beispiel #28
0
///Constructor
SFLPhoneView::SFLPhoneView(QWidget *parent)
   : QWidget(parent),m_pTransferOverlay(nullptr),m_pAutoCompletion(nullptr)
{
   new KDEPixmapManipulation();
   setupUi(this);
   KPhoneNumberSelector::init();

   //Enable on-canvas messages
   TipCollection::setManager(new TipManager(m_pView));
   m_pCanvasManager = new CanvasObjectManager();

   //Set global settings
   Audio::Settings::instance()->setEnableRoomTone(ConfigurationSkeleton::enableRoomTone());
   PresenceSerializationVisitor::setInstance(new KDEPresenceSerializationVisitor());

   m_pEventManager = new EventManager(this);
   m_pView->setModel(CallModel::instance());
   TipCollection::manager()->changeSize();
   connect(CallModel::instance(),SIGNAL(layoutChanged()),m_pView,SLOT(expandAll()));
   m_pView->expandAll();
   m_pConfDelegate = new ConferenceDelegate(m_pView,palette());
   m_pHistoryDelegate = new HistoryDelegate(m_pView);
   m_pConfDelegate->setCallDelegate(m_pHistoryDelegate);
   m_pView->setItemDelegate(m_pConfDelegate);
   m_pView->viewport()->installEventFilter(m_pEventManager);
   m_pView->installEventFilter(m_pEventManager);
   m_pView->setViewType(CategorizedTreeView::ViewType::Call);


   if (!CallModel::instance()->getActiveCalls().size())
      m_pCanvasManager->newEvent(CanvasObjectManager::CanvasEvent::NO_CALLS);

   QPalette pal = QPalette(palette());
   pal.setColor(QPalette::AlternateBase, Qt::lightGray);
   setPalette(pal);

   m_pColorVisitor = new ColorVisitor(pal);
   AccountModel::instance()->setColorVisitor(m_pColorVisitor);

   m_pMessageBoxW->setVisible(false);

   //Setup volume
   toolButton_recVol->setDefaultAction(ActionCollection::instance()->muteCaptureAction());
   toolButton_sndVol->setDefaultAction(ActionCollection::instance()->mutePlaybackAction());

   connect(slider_recVol,SIGNAL(valueChanged(int)),Audio::Settings::instance(),SLOT(setCaptureVolume(int)));
   connect(slider_sndVol,SIGNAL(valueChanged(int)),Audio::Settings::instance(),SLOT(setPlaybackVolume(int)));

   //Setup signals
   //                SENDER                             SIGNAL                              RECEIVER                SLOT                      /
   /**/connect(CallModel::instance()        , SIGNAL(incomingCall(Call*))                   , this   , SLOT(on1_incomingCall(Call*))          );
   /**/connect(AccountModel::instance() , SIGNAL(voiceMailNotify(Account*,int))         , this   , SLOT(on1_voiceMailNotify(Account*,int)) );
   /**/connect(CallModel::instance()        , SIGNAL(callStateChanged(Call*,Call::State))   , this   , SLOT(updateWindowCallState())          );
   /**/connect(AccountModel::instance() , SIGNAL(accountListUpdated())                  , this   , SLOT(updateWindowCallState())          );
   /**/connect(m_pSendMessageLE             , SIGNAL(returnPressed())                       , this   , SLOT(sendMessage())                    );
   /**/connect(m_pSendMessagePB             , SIGNAL(clicked())                             , this   , SLOT(sendMessage())                    );
   /**/connect(m_pView                      , SIGNAL(itemDoubleClicked(QModelIndex)), m_pEventManager, SLOT(enter())                          );
   /*                                                                                                                                        */

   //Volume controls
//    connect(Audio::Settings::instance(),SIGNAL(playbackVolumeChanged(int)),slider_sndVol,SLOT(setValue(int)));

   //Auto completion
   loadAutoCompletion();

   m_pCanvasToolbar = new CallViewToolbar(m_pView);
   connect(m_pView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)) , m_pCanvasToolbar, SLOT(updateState()));
   connect(CallModel::instance()    , SIGNAL(callStateChanged(Call*,Call::State))     , m_pCanvasToolbar, SLOT(updateState()));
   connect(CallModel::instance()    , SIGNAL(layoutChanged())                         , m_pCanvasToolbar, SLOT(updateState()));
}
int QTreeWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QTreeView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: itemPressed((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 1: itemClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 2: itemDoubleClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 3: itemActivated((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 4: itemEntered((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 5: itemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 6: itemExpanded((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 7: itemCollapsed((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 8: currentItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QTreeWidgetItem*(*)>(_a[2]))); break;
        case 9: itemSelectionChanged(); break;
        case 10: scrollToItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QAbstractItemView::ScrollHint(*)>(_a[2]))); break;
        case 11: scrollToItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1]))); break;
        case 12: expandItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1]))); break;
        case 13: collapseItem((*reinterpret_cast< const QTreeWidgetItem*(*)>(_a[1]))); break;
        case 14: clear(); break;
        case 15: d_func()->_q_emitItemPressed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 16: d_func()->_q_emitItemClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 17: d_func()->_q_emitItemDoubleClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 18: d_func()->_q_emitItemActivated((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 19: d_func()->_q_emitItemEntered((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 20: d_func()->_q_emitItemChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 21: d_func()->_q_emitItemExpanded((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 22: d_func()->_q_emitItemCollapsed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 23: d_func()->_q_emitCurrentItemChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 24: d_func()->_q_sort(); break;
        case 25: d_func()->_q_dataChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 26: d_func()->_q_itemsSorted(); break;
        case 27: d_func()->_q_selectionChanged((*reinterpret_cast< const QItemSelection(*)>(_a[1])),(*reinterpret_cast< const QItemSelection(*)>(_a[2]))); break;
        }
        _id -= 28;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = columnCount(); break;
        case 1: *reinterpret_cast< int*>(_v) = topLevelItemCount(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setColumnCount(*reinterpret_cast< int*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Beispiel #30
0
void FindRoomsDlg::showSelectedRoom()
{
  itemDoubleClicked( resultTable->currentItem() );
}