Merging r780:797 from trunk to branches/0.3.
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 29 Apr 2008 22:39:15 +0000 (22:39 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 29 Apr 2008 22:39:15 +0000 (22:39 +0000)
14 files changed:
build/buildconf.pri
dev-notes/QT4_TARGET_DIRECTORIES [new file with mode: 0644]
dev-notes/build-static-qt.txt [new file with mode: 0644]
src/client/networkmodel.cpp
src/client/networkmodel.h
src/qtui/chatwidget.cpp
src/qtui/mainwin.cpp
src/qtui/nicklistwidget.cpp
src/qtui/nicklistwidget.h
src/qtui/settingspages/networkssettingspage.ui
src/uisupport/abstractbuffercontainer.cpp
src/uisupport/bufferviewfilter.cpp
src/uisupport/bufferviewfilter.h
version.inc

index 81591be..ddda143 100644 (file)
@@ -7,15 +7,18 @@ release {
   CONFIG *= debug
 }
 
   CONFIG *= debug
 }
 
-sputdev {
-  DEFINES *= SPUTDEV
-}
-
-win32:static { 
-  CONFIG = release warn_on uic resources qt windows static
+win32 { 
+  CONFIG = warn_on uic resources qt silent windows
+  static { 
+    CONFIG += release static
+  }
 }
 
 mac:Tiger {
  QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
  CONFIG += x86 ppc
 }
 }
 
 mac:Tiger {
  QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
  CONFIG += x86 ppc
 }
+
+sputdev {
+  DEFINES *= SPUTDEV
+}
diff --git a/dev-notes/QT4_TARGET_DIRECTORIES b/dev-notes/QT4_TARGET_DIRECTORIES
new file mode 100644 (file)
index 0000000..2cfa624
--- /dev/null
@@ -0,0 +1 @@
+src/tools/moc src/tools/rcc src/tools/uic src/corelib src/xml src/network src/sql src/plugins/codecs src/script
diff --git a/dev-notes/build-static-qt.txt b/dev-notes/build-static-qt.txt
new file mode 100644 (file)
index 0000000..084f2c1
--- /dev/null
@@ -0,0 +1,25 @@
+[16:35:11] <EgS> 1.)
+[16:35:12] <EgS> ./configure -no-accessibility -qt-sql-sqlite -no-qt3support
+-no-gif -no-libtiff -no-libpng -no-libmng -no-libjpeg -nomake demos -nomake
+examples -nomake gui -nomake uic -nomake opengl -nomake tools -no-opengl
+-no-sm -no-xshape -no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-xrender
+-no-fontconfig -no-tablet -no-xkb
+[16:35:31] <EgS> 2.)
+[16:35:31] <EgS> $ cat QT4_TARGET_DIRECTORIES
+[16:35:31] <EgS> src/tools/moc src/tools/rcc src/tools/uic src/corelib src/xml src/network src/sql src/plugins/codecs src/script
+[16:35:38] <EgS> so eine datei ist sehr hilfreich
+[16:35:40] <EgS> und dann im src dir:
+[16:36:21] <EgS> for i in `cat /home/irc/QT4_TARGET_DIRECTORIES`; do make -C $i; done
+[16:36:28] <EgS> naja...
+[16:36:33] <EgS> $pfad halt :)
+[16:36:50] <EgS> das ganze kannste dann noch mit "make install" machen
+
+for static core:
+./configure -static -no-accessibility -qt-sql-sqlite -qt-zlib -no-qt3support \
+-no-gif -no-libtiff -no-libpng -no-libmng -no-libjpeg -nomake demos -nomake examples \
+-nomake gui -nomake uic -nomake opengl -nomake tools -no-opengl -no-sm -no-xshape \
+-no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-fontconfig -no-tablet \
+-no-xkb -no-glib -no-svg -openssl-linked -no-phonon -no-webkit -no-dbus -no-xmlpatterns \
+-prefix /usr/local/Trolltech/qt-4.4-static
+
+for i in `cat /home/sputnick/devel/quassel/dev-notes/QT4_TARGET_DIRECTORIES`; do make -C $i; done
index bec3edf..940feb7 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "util.h" // get rid of this (needed for isChannelName)
 
 
 #include "util.h" // get rid of this (needed for isChannelName)
 
-
 /*****************************************
 *  Fancy Buffer Items
 *****************************************/
 /*****************************************
 *  Fancy Buffer Items
 *****************************************/
@@ -70,10 +69,11 @@ bool BufferItem::isActive() const {
     return qobject_cast<NetworkItem *>(parent())->isActive();
 }
 
     return qobject_cast<NetworkItem *>(parent())->isActive();
 }
 
-bool BufferItem::setActivityLevel(Buffer::ActivityLevel level) {
-  _activity = level;
-  emit dataChanged();
-  return true;
+void BufferItem::setActivityLevel(Buffer::ActivityLevel level) {
+  if(_activity != level) {
+    _activity = level;
+    emit dataChanged();
+  }
 }
 
 void BufferItem::updateActivityLevel(Buffer::ActivityLevel level) {
 }
 
 void BufferItem::updateActivityLevel(Buffer::ActivityLevel level) {
@@ -107,7 +107,8 @@ QVariant BufferItem::data(int column, int role) const {
 bool BufferItem::setData(int column, const QVariant &value, int role) {
   switch(role) {
   case NetworkModel::BufferActivityRole:
 bool BufferItem::setData(int column, const QVariant &value, int role) {
   switch(role) {
   case NetworkModel::BufferActivityRole:
-    return setActivityLevel((Buffer::ActivityLevel)value.toInt());
+    setActivityLevel((Buffer::ActivityLevel)value.toInt());
+    return true;
   default:
     return PropertyMapItem::setData(column, value, role);
   }
   default:
     return PropertyMapItem::setData(column, value, role);
   }
index 634c402..2a342a6 100644 (file)
@@ -72,7 +72,7 @@ public:
   bool isActive() const;
 
   inline Buffer::ActivityLevel activityLevel() const { return _activity; }
   bool isActive() const;
 
   inline Buffer::ActivityLevel activityLevel() const { return _activity; }
-  bool setActivityLevel(Buffer::ActivityLevel level);
+  void setActivityLevel(Buffer::ActivityLevel level);
   void updateActivityLevel(Buffer::ActivityLevel level);
 
   void setLastMsgInsert(QDateTime msgDate);
   void updateActivityLevel(Buffer::ActivityLevel level);
 
   void setLastMsgInsert(QDateTime msgDate);
index 6c2da6e..f386b8e 100644 (file)
@@ -423,7 +423,11 @@ void ChatWidget::mouseReleaseEvent(QMouseEvent *event) {
         selectionStart = qMin(dragStartLine, curLine);
         selectionEnd = qMax(dragStartLine, curLine);
         // TODO Make X11SelectionMode configurable!
         selectionStart = qMin(dragStartLine, curLine);
         selectionEnd = qMax(dragStartLine, curLine);
         // TODO Make X11SelectionMode configurable!
+#ifdef Q_WS_X11
+        QApplication::clipboard()->setText(selectionToString(), QClipboard::Selection);
+#else
         QApplication::clipboard()->setText(selectionToString());
         QApplication::clipboard()->setText(selectionToString());
+#endif
         break;
       default:
         mouseMode = Normal;
         break;
       default:
         mouseMode = Normal;
index 5e6cfad..fb610e0 100644 (file)
@@ -269,7 +269,8 @@ void MainWin::setupNickWidget() {
 
   addDockWidget(Qt::RightDockWidgetArea, nickDock);
   ui.menuViews->addAction(nickDock->toggleViewAction());
 
   addDockWidget(Qt::RightDockWidgetArea, nickDock);
   ui.menuViews->addAction(nickDock->toggleViewAction());
-  connect(nickDock->toggleViewAction(), SIGNAL(triggered(bool)), nickListWidget, SLOT(showWidget(bool)));
+  // See NickListDock::NickListDock();
+  // connect(nickDock->toggleViewAction(), SIGNAL(triggered(bool)), nickListWidget, SLOT(showWidget(bool)));
 
   // attach the NickListWidget to the BufferModel and the default selection
   nickListWidget->setModel(Client::bufferModel());
 
   // attach the NickListWidget to the BufferModel and the default selection
   nickListWidget->setModel(Client::bufferModel());
index ebd1825..d647b5d 100644 (file)
@@ -69,21 +69,26 @@ void NickListWidget::currentChanged(const QModelIndex &current, const QModelInde
   BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
   BufferId oldBufferId = previous.data(NetworkModel::BufferIdRole).value<BufferId>();
 
   BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
   BufferId oldBufferId = previous.data(NetworkModel::BufferIdRole).value<BufferId>();
 
-
   if(bufferType != BufferInfo::ChannelBuffer) {
     ui.stackedWidget->setCurrentWidget(ui.emptyPage);
   if(bufferType != BufferInfo::ChannelBuffer) {
     ui.stackedWidget->setCurrentWidget(ui.emptyPage);
-    QDockWidget *dock_ = dock();
-    if(dock_) {
-      dock_->close();
-    }
     return;
     return;
-  } else {
-    QDockWidget *dock_ = dock();
-    if(dock_ && dock_->toggleViewAction()->isChecked()) {
-      dock_->show();
-    }
   }
 
   }
 
+  // See NickListDock::NickListDock() below
+//   if(bufferType != BufferInfo::ChannelBuffer) {
+//     ui.stackedWidget->setCurrentWidget(ui.emptyPage);
+//     QDockWidget *dock_ = dock();
+//     if(dock_) {
+//       dock_->close();
+//     }
+//     return;
+//   } else {
+//     QDockWidget *dock_ = dock();
+//     if(dock_ && dock_->toggleViewAction()->isChecked()) {
+//       dock_->show();
+//     }
+//   }
+
   if(newBufferId == oldBufferId)
     return;
 
   if(newBufferId == oldBufferId)
     return;
 
@@ -163,28 +168,31 @@ QSize NickListWidget::sizeHint() const {
 NickListDock::NickListDock(const QString &title, QWidget *parent)
   : QDockWidget(title, parent)
 {
 NickListDock::NickListDock(const QString &title, QWidget *parent)
   : QDockWidget(title, parent)
 {
-  QAction *toggleView = toggleViewAction();
-  disconnect(toggleView, SIGNAL(triggered(bool)), this, 0);
-  toggleView->setChecked(QtUiSettings().value("ShowNickList", QVariant(true)).toBool());
-
-  // reconnecting the closebuttons clicked signal to the action
-  foreach(QAbstractButton *button, findChildren<QAbstractButton *>()) {
-    if(disconnect(button, SIGNAL(clicked()), this, SLOT(close())))
-      connect(button, SIGNAL(clicked()), toggleView, SLOT(trigger()));
-  }
+  // THIS STUFF IS NEEDED FOR NICKLIST AUTOHIDE... 
+  // AS THIS BRINGS LOTS OF FUCKUPS WITH IT IT'S DEACTIVATED FOR NOW...
+  
+//   QAction *toggleView = toggleViewAction();
+//   disconnect(toggleView, SIGNAL(triggered(bool)), this, 0);
+//   toggleView->setChecked(QtUiSettings().value("ShowNickList", QVariant(true)).toBool());
+
+//   // reconnecting the closebuttons clicked signal to the action
+//   foreach(QAbstractButton *button, findChildren<QAbstractButton *>()) {
+//     if(disconnect(button, SIGNAL(clicked()), this, SLOT(close())))
+//       connect(button, SIGNAL(clicked()), toggleView, SLOT(trigger()));
+//   }
 }
 
 }
 
-NickListDock::~NickListDock() {
-  QtUiSettings().setValue("ShowNickList", toggleViewAction()->isChecked());
-}
-
-bool NickListDock::event(QEvent *event) {
-  switch (event->type()) {
-  case QEvent::Hide:
-  case QEvent::Show:
-    emit visibilityChanged(event->type() == QEvent::Show);
-    return QWidget::event(event);
-  default:
-    return QDockWidget::event(event);
-  }
-}
+// NickListDock::~NickListDock() {
+//   QtUiSettings().setValue("ShowNickList", toggleViewAction()->isChecked());
+// }
+
+// bool NickListDock::event(QEvent *event) {
+//   switch (event->type()) {
+//   case QEvent::Hide:
+//   case QEvent::Show:
+//     emit visibilityChanged(event->type() == QEvent::Show);
+//     return QWidget::event(event);
+//   default:
+//     return QDockWidget::event(event);
+//   }
+// }
index 2da05a9..c5e9b8e 100644 (file)
@@ -69,9 +69,9 @@ class NickListDock : public QDockWidget {
 
 public:
   NickListDock(const QString &title, QWidget *parent = 0);
 
 public:
   NickListDock(const QString &title, QWidget *parent = 0);
-  ~NickListDock();
+  // ~NickListDock();
 
 
-  virtual bool event(QEvent *event);
+  // virtual bool event(QEvent *event);
 };
 
 #endif
 };
 
 #endif
index 7eb6448..aae2401 100644 (file)
 Unless you *really* know what you do, leave this as ISO-8859-1!</string>
         </property>
         <property name="currentIndex" >
 Unless you *really* know what you do, leave this as ISO-8859-1!</string>
         </property>
         <property name="currentIndex" >
-         <number>0</number>
+         <number>1</number>
         </property>
         <widget class="QWidget" name="serversTab" >
          <property name="enabled" >
         </property>
         <widget class="QWidget" name="serversTab" >
          <property name="enabled" >
@@ -171,8 +171,8 @@ Unless you *really* know what you do, leave this as ISO-8859-1!</string>
           <rect>
            <x>0</x>
            <y>0</y>
           <rect>
            <x>0</x>
            <y>0</y>
-           <width>244</width>
-           <height>332</height>
+           <width>301</width>
+           <height>326</height>
           </rect>
          </property>
          <attribute name="title" >
           </rect>
          </property>
          <attribute name="title" >
@@ -337,8 +337,8 @@ Unless you *really* know what you do, leave this as ISO-8859-1!</string>
           <rect>
            <x>0</x>
            <y>0</y>
           <rect>
            <x>0</x>
            <y>0</y>
-           <width>244</width>
-           <height>332</height>
+           <width>301</width>
+           <height>326</height>
           </rect>
          </property>
          <attribute name="title" >
           </rect>
          </property>
          <attribute name="title" >
@@ -377,6 +377,13 @@ Unless you *really* know what you do, leave this as ISO-8859-1!</string>
              <bool>true</bool>
             </property>
             <layout class="QGridLayout" name="gridLayout" >
              <bool>true</bool>
             </property>
             <layout class="QGridLayout" name="gridLayout" >
+             <item row="0" column="0" >
+              <widget class="QLabel" name="label_2" >
+               <property name="text" >
+                <string>Service:</string>
+               </property>
+              </widget>
+             </item>
              <item row="0" column="1" >
               <widget class="QLineEdit" name="autoIdentifyService" >
                <property name="enabled" >
              <item row="0" column="1" >
               <widget class="QLineEdit" name="autoIdentifyService" >
                <property name="enabled" >
@@ -387,30 +394,23 @@ Unless you *really* know what you do, leave this as ISO-8859-1!</string>
                </property>
               </widget>
              </item>
                </property>
               </widget>
              </item>
-             <item row="1" column="1" >
-              <widget class="QLineEdit" name="autoIdentifyPassword" >
+             <item row="1" column="0" >
+              <widget class="QLabel" name="label_3" >
                <property name="enabled" >
                 <bool>true</bool>
                </property>
                <property name="enabled" >
                 <bool>true</bool>
                </property>
-               <property name="echoMode" >
-                <enum>QLineEdit::Password</enum>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="0" >
-              <widget class="QLabel" name="label_2" >
                <property name="text" >
                <property name="text" >
-                <string>Service:</string>
+                <string>Password:</string>
                </property>
               </widget>
              </item>
                </property>
               </widget>
              </item>
-             <item row="1" column="0" >
-              <widget class="QLabel" name="label_3" >
+             <item row="1" column="1" >
+              <widget class="QLineEdit" name="autoIdentifyPassword" >
                <property name="enabled" >
                 <bool>true</bool>
                </property>
                <property name="enabled" >
                 <bool>true</bool>
                </property>
-               <property name="text" >
-                <string>Password:</string>
+               <property name="echoMode" >
+                <enum>QLineEdit::Password</enum>
                </property>
               </widget>
              </item>
                </property>
               </widget>
              </item>
index fd2b9da..f3ffbf8 100644 (file)
 #include "client.h"
 #include "networkmodel.h"
 
 #include "client.h"
 #include "networkmodel.h"
 
-AbstractBufferContainer::AbstractBufferContainer(QWidget *parent) : AbstractItemView(parent), _currentBuffer(0)
+AbstractBufferContainer::AbstractBufferContainer(QWidget *parent)
+  : AbstractItemView(parent),
+    _currentBuffer(0)
 {
 {
-
 }
 
 AbstractBufferContainer::~AbstractBufferContainer() {
 }
 
 AbstractBufferContainer::~AbstractBufferContainer() {
-
 }
 
 
 }
 
 
index 7505907..5038736 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "bufferviewfilter.h"
 
 
 #include "bufferviewfilter.h"
 
-#include <QColor>
-
 #include "buffermodel.h"
 #include "client.h"
 #include "networkmodel.h"
 #include "buffermodel.h"
 #include "client.h"
 #include "networkmodel.h"
@@ -40,6 +38,17 @@ BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *
   connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(source_rowsInserted(const QModelIndex &, int, int)));
                        
   setDynamicSortFilter(true);
   connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(source_rowsInserted(const QModelIndex &, int, int)));
                        
   setDynamicSortFilter(true);
+
+  loadColors();
+}
+
+void BufferViewFilter::loadColors() {
+  UiSettings s("QtUi/Colors");
+  _FgColorInactiveActivity = s.value("inactiveActivityFG", QVariant(QColor(Qt::gray))).value<QColor>();
+  _FgColorNoActivity = s.value("noActivityFG", QVariant(QColor(Qt::black))).value<QColor>();
+  _FgColorHighlightActivity = s.value("highlightActivityFG", QVariant(QColor(Qt::magenta))).value<QColor>();
+  _FgColorNewMessageActivity = s.value("newMessageActivityFG", QVariant(QColor(Qt::green))).value<QColor>();
+  _FgColorOtherActivity = s.value("otherActivityFG", QVariant(QColor(Qt::darkGreen))).value<QColor>();
 }
 
 void BufferViewFilter::setConfig(BufferViewConfig *config) {
 }
 
 void BufferViewFilter::setConfig(BufferViewConfig *config) {
@@ -230,27 +239,19 @@ QVariant BufferViewFilter::data(const QModelIndex &index, int role) const {
 }
 
 QVariant BufferViewFilter::foreground(const QModelIndex &index) const {
 }
 
 QVariant BufferViewFilter::foreground(const QModelIndex &index) const {
-  UiSettings s("QtUi/Colors");
-  QVariant inactiveActivity = s.value("inactiveActivityFG", QVariant(QColor(Qt::gray)));
-  QVariant noActivity = s.value("noActivityFG", QVariant(QColor(Qt::black)));
-  QVariant highlightActivity = s.value("highlightActivityFG", QVariant(QColor(Qt::magenta)));
-  QVariant newMessageActivity = s.value("newMessageActivityFG", QVariant(QColor(Qt::green)));
-  QVariant otherActivity = s.value("otherActivityFG", QVariant(QColor(Qt::darkGreen)));
-
   if(!index.data(NetworkModel::ItemActiveRole).toBool())
   if(!index.data(NetworkModel::ItemActiveRole).toBool())
-    return inactiveActivity;
+    return _FgColorInactiveActivity;
 
   Buffer::ActivityLevel activity = (Buffer::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
 
   if(activity & Buffer::Highlight)
 
   Buffer::ActivityLevel activity = (Buffer::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
 
   if(activity & Buffer::Highlight)
-    return highlightActivity;
+    return _FgColorHighlightActivity;
   if(activity & Buffer::NewMessage)
   if(activity & Buffer::NewMessage)
-    return newMessageActivity;
+    return _FgColorNewMessageActivity;
   if(activity & Buffer::OtherActivity)
   if(activity & Buffer::OtherActivity)
-    return otherActivity;
-
-  return noActivity;
+    return _FgColorOtherActivity;
 
 
+  return _FgColorNoActivity;
 }
 
 void BufferViewFilter::source_rowsInserted(const QModelIndex &parent, int start, int end) {
 }
 
 void BufferViewFilter::source_rowsInserted(const QModelIndex &parent, int start, int end) {
index 07fec1b..4715f11 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef BUFFERVIEWFILTER_H_
 #define BUFFERVIEWFILTER_H_
 
 #ifndef BUFFERVIEWFILTER_H_
 #define BUFFERVIEWFILTER_H_
 
+#include <QColor>
 #include <QDropEvent>
 #include <QFlags>
 #include <QPointer>
 #include <QDropEvent>
 #include <QFlags>
 #include <QPointer>
@@ -73,6 +74,13 @@ protected:
 private:
   QPointer<BufferViewConfig> _config;
 
 private:
   QPointer<BufferViewConfig> _config;
 
+  QColor _FgColorInactiveActivity;
+  QColor _FgColorNoActivity;
+  QColor _FgColorHighlightActivity;
+  QColor _FgColorNewMessageActivity;
+  QColor _FgColorOtherActivity;
+  void loadColors();
+  
   bool filterAcceptBuffer(const QModelIndex &) const;
   bool filterAcceptNetwork(const QModelIndex &) const;
   void addBuffer(const BufferId &);
   bool filterAcceptBuffer(const QModelIndex &) const;
   bool filterAcceptNetwork(const QModelIndex &) const;
   void addBuffer(const BufferId &);
index 53e17af..fc54420 100644 (file)
@@ -4,8 +4,8 @@
 { using namespace Global;
 
   quasselVersion = "0.2.0-beta1-pre";
 { using namespace Global;
 
   quasselVersion = "0.2.0-beta1-pre";
-  quasselDate = "2008-04-21";
-  quasselBuild = 786;
+  quasselDate = "2008-04-29";
+  quasselBuild = 797;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 731;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 731;