Some more tweaking for QuasselTopia.
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 29 Nov 2007 18:51:29 +0000 (18:51 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 29 Nov 2007 18:51:29 +0000 (18:51 +0000)
src/client/buffer.cpp
src/qtopia/mainwidget.cpp
src/qtopia/mainwidget.h
src/qtopia/qtopiamainwin.cpp
src/qtopia/quasseltopia.desktop
src/qtopia/topicbar.cpp

index 023263b..b533dd6 100644 (file)
@@ -107,12 +107,12 @@ QVariantMap Buffer::nickList() const {
 }
 
 QString Buffer::topic() const {
 }
 
 QString Buffer::topic() const {
-  // FIXME check if we got a networkInfo() object
+  if(ircChannel()) return ircChannel()->topic();
   return QString();
 }
 
 QString Buffer::ownNick() const {
   return QString();
 }
 
 QString Buffer::ownNick() const {
-  // FIXME check if we got a networkInfo() object
+  // FIXME if(ircChannel()) return ircChannel()->ownNick();
   return QString();
 }
 
   return QString();
 }
 
@@ -165,6 +165,8 @@ void Buffer::setIrcChannel(IrcChannel *ircchan) {
   }
   _ircChannel = ircchan;
   if(_ircChannel) {
   }
   _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());
     connect(_ircChannel, SIGNAL(destroyed()), this, SLOT(setIrcChannel()));
   }
   _nickModel->setIrcChannel(ircChannel());
@@ -172,11 +174,6 @@ void Buffer::setIrcChannel(IrcChannel *ircchan) {
 
 // no longer needed
 // back reference:
 
 // 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);
 
 // void Buffer::addNick(QString nick, QVariantMap props) {
 //   if(nick == ownNick()) setActive(true);
index b083a8e..65d5286 100644 (file)
@@ -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 *)));
     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);
     //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();
 }
   }
   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);
+  }
+}
index 360af06..1893eb6 100644 (file)
@@ -34,6 +34,7 @@ class MainWidget : public QWidget {
     ~MainWidget();
 
   public slots:
     ~MainWidget();
 
   public slots:
+    void setTopic(QString topic);
     void setBuffer(Buffer *);
 
   private slots:
     void setBuffer(Buffer *);
 
   private slots:
index 02bbe71..e58ef1b 100644 (file)
@@ -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  *
  *   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)));
 
 void QtopiaMainWin::init() {
   Client::signalProxy()->attachSignal(this, SIGNAL(requestBacklog(BufferInfo, QVariant, QVariant)));
 
+  showMaximized();
   CoreConnectDlg *dlg = new CoreConnectDlg(this);
   //setCentralWidget(dlg);
   dlg->showMaximized();
   CoreConnectDlg *dlg = new CoreConnectDlg(this);
   //setCentralWidget(dlg);
   dlg->showMaximized();
index a71b48d..e1ca46d 100644 (file)
@@ -5,6 +5,6 @@
 [Desktop Entry]
 Comment[]=A Next-Gen IRC Client
 Exec=quasseltopia
 [Desktop Entry]
 Comment[]=A Next-Gen IRC Client
 Exec=quasseltopia
-Icon=quasselirc/qirc-icon
+Icon=/pics/quasselirc/qirc-icon.png
 Type=Application
 Name[]=QuasselTopia
 Type=Application
 Name[]=QuasselTopia
index a5140f4..7921c05 100644 (file)
@@ -38,7 +38,7 @@ TopicBar::TopicBar(QWidget *parent) : QPushButton(parent) {
   fillText = " *** ";
   oneshot = true;
   timer = new QTimer(this);
   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()));
 }
   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() {
 }
 
 void TopicBar::updateOffset() {
-  offset++;
+  offset+=1;
   if(offset >= secondTextStart) {
     offset = 0;
     if(oneshot) timer->stop(); // only scroll once!
   if(offset >= secondTextStart) {
     offset = 0;
     if(oneshot) timer->stop(); // only scroll once!