From d47cd9b56ba10dc6e20baeabbd2b51305824b8c2 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 29 Nov 2007 18:51:29 +0000 Subject: [PATCH 1/1] Some more tweaking for QuasselTopia. --- src/client/buffer.cpp | 11 ++++------- src/qtopia/mainwidget.cpp | 11 ++++++++++- src/qtopia/mainwidget.h | 1 + src/qtopia/qtopiamainwin.cpp | 3 ++- src/qtopia/quasseltopia.desktop | 2 +- src/qtopia/topicbar.cpp | 4 ++-- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/client/buffer.cpp b/src/client/buffer.cpp index 023263bb..b533dd6c 100644 --- a/src/client/buffer.cpp +++ b/src/client/buffer.cpp @@ -107,12 +107,12 @@ QVariantMap Buffer::nickList() const { } QString Buffer::topic() const { - // FIXME check if we got a networkInfo() object + if(ircChannel()) return ircChannel()->topic(); return QString(); } QString Buffer::ownNick() const { - // FIXME check if we got a networkInfo() object + // FIXME if(ircChannel()) return ircChannel()->ownNick(); return QString(); } @@ -165,6 +165,8 @@ void Buffer::setIrcChannel(IrcChannel *ircchan) { } _ircChannel = ircchan; if(_ircChannel) { + emit topicSet(_ircChannel->topic()); + connect(_ircChannel, SIGNAL(topicSet(QString)), this, SIGNAL(topicSet(QString))); connect(_ircChannel, SIGNAL(destroyed()), this, SLOT(setIrcChannel())); } _nickModel->setIrcChannel(ircChannel()); @@ -172,11 +174,6 @@ void Buffer::setIrcChannel(IrcChannel *ircchan) { // no longer needed // back reference: -// void Buffer::setTopic(QString t) { -// _topic = t; -// emit topicSet(t); -// emit bufferUpdated(this); -// } // void Buffer::addNick(QString nick, QVariantMap props) { // if(nick == ownNick()) setActive(true); diff --git a/src/qtopia/mainwidget.cpp b/src/qtopia/mainwidget.cpp index b083a8ec..65d52861 100644 --- a/src/qtopia/mainwidget.cpp +++ b/src/qtopia/mainwidget.cpp @@ -58,7 +58,7 @@ void MainWidget::setBuffer(Buffer *buf) { chatWidget->setContents(lines); connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *))); connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), chatWidget, SLOT(prependMsg(AbstractUiMsg *))); - //connect(buf, SIGNAL(topicSet(QString)), this, SLOT(setTopic(QString))); + connect(buf, SIGNAL(topicSet(QString)), this, SLOT(setTopic(QString))); //connect(buf, SIGNAL(ownNickSet(QString)), this, SLOT(setOwnNick(QString))); ui.stack->addWidget(chatWidget); chatWidgets.insert(buf, chatWidget); @@ -78,3 +78,12 @@ void MainWidget::enterPressed() { } ui.inputLine->clear(); } + +// FIXME make this more elegant, we don't need to send a string around... +void MainWidget::setTopic(QString topic) { + Q_UNUSED(topic); + if(currentBuffer) { + QString title = QString("%1 (%2): \"%3\"").arg(currentBuffer->name()).arg(currentBuffer->networkName()).arg(currentBuffer->topic()); + ui.topicBar->setContents(title); + } +} diff --git a/src/qtopia/mainwidget.h b/src/qtopia/mainwidget.h index 360af068..1893eb6c 100644 --- a/src/qtopia/mainwidget.h +++ b/src/qtopia/mainwidget.h @@ -34,6 +34,7 @@ class MainWidget : public QWidget { ~MainWidget(); public slots: + void setTopic(QString topic); void setBuffer(Buffer *); private slots: diff --git a/src/qtopia/qtopiamainwin.cpp b/src/qtopia/qtopiamainwin.cpp index 02bbe712..e58ef1b0 100644 --- a/src/qtopia/qtopiamainwin.cpp +++ b/src/qtopia/qtopiamainwin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by The Quassel IRC Development Team * + * Copyright (C) 2005-07 by the Quassel IRC Team * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -83,6 +83,7 @@ QtopiaMainWin::QtopiaMainWin(QWidget *parent, Qt::WFlags flags) : QMainWindow(pa void QtopiaMainWin::init() { Client::signalProxy()->attachSignal(this, SIGNAL(requestBacklog(BufferInfo, QVariant, QVariant))); + showMaximized(); CoreConnectDlg *dlg = new CoreConnectDlg(this); //setCentralWidget(dlg); dlg->showMaximized(); diff --git a/src/qtopia/quasseltopia.desktop b/src/qtopia/quasseltopia.desktop index a71b48da..e1ca46d4 100644 --- a/src/qtopia/quasseltopia.desktop +++ b/src/qtopia/quasseltopia.desktop @@ -5,6 +5,6 @@ [Desktop Entry] Comment[]=A Next-Gen IRC Client Exec=quasseltopia -Icon=quasselirc/qirc-icon +Icon=/pics/quasselirc/qirc-icon.png Type=Application Name[]=QuasselTopia diff --git a/src/qtopia/topicbar.cpp b/src/qtopia/topicbar.cpp index a5140f43..7921c059 100644 --- a/src/qtopia/topicbar.cpp +++ b/src/qtopia/topicbar.cpp @@ -38,7 +38,7 @@ TopicBar::TopicBar(QWidget *parent) : QPushButton(parent) { fillText = " *** "; oneshot = true; timer = new QTimer(this); - timer->setInterval(20); + timer->setInterval(25); connect(timer, SIGNAL(timeout()), this, SLOT(updateOffset())); connect(this, SIGNAL(clicked()), this, SLOT(startScrolling())); } @@ -88,7 +88,7 @@ void TopicBar::paintEvent(QPaintEvent *event) { } void TopicBar::updateOffset() { - offset++; + offset+=1; if(offset >= secondTextStart) { offset = 0; if(oneshot) timer->stop(); // only scroll once! -- 2.20.1