ConversationsModel::ConversationsModel(QObject *parent) :
    QAbstractListModel(parent),
    Tp::AbstractClientHandler(channelClassList()),
    d(new ConversationsModelPrivate)
{
    d->activeChatIndex = -1;
    connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), SIGNAL(totalUnreadCountChanged()));
    connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), SIGNAL(totalUnreadCountChanged()));
}
Esempio n. 2
0
TelepathyChatUi::TelepathyChatUi()
    : KApplication(), AbstractClientHandler(channelClassList())
{
    kDebug();

    KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
    KConfigGroup tabConfig = config->group("Behavior");

    // load the settings for new tab "open mode"
    QString mode = tabConfig.readEntry("tabOpenMode", "FirstWindow");
    if (mode == QLatin1String("NewWindow")) {
        m_openMode = NewWindow;
    } else if (mode == QLatin1String("FirstWindow")) {
        m_openMode = FirstWindow;
    } else if (mode == QLatin1String("LastWindow")) {
        m_openMode = LastWindow;
    }
}
Esempio n. 3
0
TelepathyChatUi::TelepathyChatUi(int &argc, char *argv[])
    : KTp::TelepathyHandlerApplication(argc, argv, -1, -1),
      AbstractClientHandler(channelClassList())
{
    // We need to set up KAboutData in here, before the ChatWindow gets created,
    // otherwise the Settings and Help menu will not have the Application Name
    // set and will contain just "ktp-text-ui".
    KAboutData aboutData("ktp-text-ui", i18n("Chat Application"), QStringLiteral(KTP_TEXT_UI_VERSION_STRING));
    aboutData.addAuthor(i18n("David Edmundson"), i18n("Developer"), "*****@*****.**");
    aboutData.addAuthor(i18n("Marcin Ziemiński"), i18n("Developer"), "*****@*****.**");
    aboutData.addAuthor(i18n("Dominik Schmidt"), i18n("Past Developer"), "*****@*****.**");
    aboutData.addAuthor(i18n("Francesco Nwokeka"), i18n("Past Developer"), "*****@*****.**");
    aboutData.setProductName("telepathy/text-ui"); //set the correct name for bug reporting
    aboutData.setLicense(KAboutLicense::GPL_V2);

    QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("telepathy-kde")));
    KAboutData::setApplicationData(aboutData);

    m_eventLoopLocker = 0;
    m_notifyFilter = new NotifyFilter;
    ChatWindow *window = createWindow();
    window->show();
}