CreateFolderContentsWidget::CreateFolderContentsWidget(Trip *trip, int role, const QString &type, QWidget* parent) : QStackedWidget(parent), m_trip(trip), m_role(role) { QPushButton *button = new QPushButton("Select " + type); QString iconName; switch (role) { case Trip::MailCollectionRole: iconName = "kmail"; break; case Trip::NotesCollectionRole: iconName = "knotes"; break; case Trip::TodoCollectionRole: iconName = "korg-todo"; break; } KIcon icon(iconName); button->setIcon(icon); button->setIconSize(QSize(128, 128)); addWidget(button); m_widget = new FolderContentsWidget(trip, role, type); addWidget(m_widget); connect(button, SIGNAL(clicked(bool)), m_widget, SLOT(configure())); connect(m_trip, SIGNAL(monitoredCollectionsChanged()), SLOT(collectionSelected())); }
void CollectionListView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { QListView::currentChanged(current, previous); //set current collection on selection change if (current.isValid()) collectionSelected(current); }
ArchiveDlg::ArchiveDlg(const XMPP::Jid &jid, PsiAccount *pa) { max = 30; page_ = 0; setupUi(this); tw_log->setColumnCount(3); QStringList headers; headers << tr("Time") << tr("") << tr("Message"); tw_log->setHeaderLabels(headers); setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("Archive for ") + jid.full()); #ifndef Q_WS_MAC setWindowIcon(IconsetFactory::icon("psi/history").icon()); #endif gct_ = NULL; pa_ = pa; jid_ = jid; last_ = QDateTime::currentDateTime(); connect(pb_close, SIGNAL(clicked()), this, SLOT(hide())); connect(calendar, SIGNAL(selectionChanged()), this, SLOT(dateSelected())); connect(calendar, SIGNAL(currentPageChanged(int, int)), this, SLOT(dateChanged(int, int))); connect(lw_conversations, SIGNAL(itemSelectionChanged()), this, SLOT(collectionSelected())); connect(lw_conversations, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(doCollectionContextMenu(const QPoint&))); lw_conversations-> connect(tb_prevPage, SIGNAL(clicked()), this, SLOT(prevPage())); connect(tb_nextPage, SIGNAL(clicked()), this, SLOT(nextPage())); gclt_ = new GetCollectionListTask(pa->client()->rootTask()); connect(gclt_, SIGNAL(busy()), this, SLOT(busy())); connect(gclt_, SIGNAL(done()), this, SLOT(collectionListRetrieved())); connect(gclt_, SIGNAL(error()), this, SLOT(error())); gct_ = new GetCollectionTask(pa_->client()->rootTask()); connect(gct_, SIGNAL(busy()), this, SLOT(busy())); connect(gct_, SIGNAL(done(int)), this, SLOT(collectionRetrieved(int))); connect(gct_, SIGNAL(msg(int, bool, const QString&)), this, SLOT(collectionMsg(int, bool, const QString&))); connect(gct_, SIGNAL(error()), this, SLOT(error())); QDate m(last_.date().year(), last_.date().month(), 1); gclt_->get(jid, m, 50); // X11WM_CLASS("history"); }
void CollectionSelectorModel::indexChanged(int index) { int id = 0; if (index >= 0) // QComboBox will send -1 if the current item is removed. id = _root->child(index, 0)->data(Qt::UserRole).toInt(); if (id > 0) { _collection = QPointer<Collection>(new Collection(_db, id)); emit collectionSelected(id); return; } if (_all) { emit allSelected(); return; } emit noneSelected(); }