* Use Haui's new channelwidget. Yeah, it's still just a telnet client, but it looks...
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 21 Oct 2006 00:27:11 +0000 (00:27 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 21 Oct 2006 00:27:11 +0000 (00:27 +0000)
* Save/Restore MainWin size and pos.

gui/CMakeLists.txt
gui/channelwidget.cpp
gui/channelwidget.h
gui/channelwidget.ui
gui/mainwin.cpp
gui/mainwin.h

index d4d5ef1..8a8c328 100644 (file)
@@ -1,7 +1,7 @@
 SET(gui_SRCS channelwidget.cpp mainwin.cpp serverlist.cpp coreconnectdlg.cpp guiproxy.cpp)
 SET(gui_HDRS )
 SET(gui_MOCS channelwidget.h mainwin.h serverlist.h coreconnectdlg.h guiproxy.h)
-SET(gui_UICS channelwidget-old.ui identitiesdlg.ui identitieseditdlg.ui networkeditdlg.ui nickeditdlg.ui serverlistdlg.ui coreconnectdlg.ui)
+SET(gui_UICS channelwidget.ui identitiesdlg.ui identitieseditdlg.ui networkeditdlg.ui nickeditdlg.ui serverlistdlg.ui coreconnectdlg.ui)
 
 QT4_WRAP_UI(_UIC ${gui_UICS})
 QT4_WRAP_CPP(_MOC ${gui_MOCS})
index 7ff4537..9cc0576 100644 (file)
@@ -42,7 +42,7 @@ ChannelWidget::ChannelWidget(QWidget *parent) : QWidget(parent) {
   //connect(&core, SIGNAL(outputLine( const QString& )), ui.textBrowser, SLOT(insertPlainText(const QString &)));
   //connect(ui.lineEdit, SIGNAL(
   //connect(&core, SIGNAL(outputLine( const QString& )), this, SLOT(lineReceived(const QString &)));
-  connect(ui.lineEdit, SIGNAL(returnPressed()), this, SLOT(enterPressed()));
+  connect(ui.inputEdit, SIGNAL(returnPressed()), this, SLOT(enterPressed()));
   //connect(this, SIGNAL(inputLine( const QString& )), &core, SLOT(inputLine( const QString& )));
 
   connect(this, SIGNAL(inputLine(QString)), guiProxy, SLOT(gsUserInput(QString)));
@@ -54,11 +54,11 @@ ChannelWidget::ChannelWidget(QWidget *parent) : QWidget(parent) {
 }
 
 void ChannelWidget::enterPressed() {
-  emit inputLine(ui.lineEdit->text());
-  ui.lineEdit->clear();
+  emit inputLine(ui.inputEdit->text());
+  ui.inputEdit->clear();
 }
 
 void ChannelWidget::lineReceived(QString s) {
-  ui.textBrowser->insertPlainText(s + "\n");
-  ui.textBrowser->ensureCursorVisible();
+  ui.chatWidget->insertPlainText(s + "\n");
+  ui.chatWidget->ensureCursorVisible();
 }
index cecde30..932c538 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef _CHANNELWIDGET_H_
 #define _CHANNELWIDGET_H_
 
-#include "ui_channelwidget-old.h"
+#include "ui_channelwidget.h"
 
 class ChannelWidget : public QWidget {
   Q_OBJECT
index 99b1448..f5bb9d8 100644 (file)
@@ -1,12 +1,12 @@
 <ui version="4.0" >
- <class>ChannelWin</class>
- <widget class="QWidget" name="ChannelWin" >
+ <class>ChannelWidget</class>
+ <widget class="QWidget" name="ChannelWidget" >
   <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>595</width>
-    <height>407</height>
+    <width>723</width>
+    <height>546</height>
    </rect>
   </property>
   <property name="contextMenuPolicy" >
   <property name="windowTitle" >
    <string>YourNickname #quassel Network: The Topic</string>
   </property>
-  <layout class="QGridLayout" >
+  <layout class="QVBoxLayout" >
    <property name="margin" >
     <number>9</number>
    </property>
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="0" column="0" >
-    <layout class="QVBoxLayout" >
+   <item>
+    <layout class="QHBoxLayout" >
      <property name="margin" >
       <number>0</number>
      </property>
       <number>6</number>
      </property>
      <item>
-      <layout class="QHBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <widget class="QLineEdit" name="lineEdit_2" />
-       </item>
-       <item>
-        <widget class="QToolButton" name="toolButton" >
-         <property name="windowModality" >
-          <enum>Qt::NonModal</enum>
-         </property>
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="layoutDirection" >
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text" >
-          <string>...</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
+      <widget class="QLineEdit" name="topicEdit" />
      </item>
      <item>
-      <widget class="QSplitter" name="splitter" >
+      <widget class="QToolButton" name="chanSettingsButton" >
+       <property name="windowModality" >
+        <enum>Qt::NonModal</enum>
+       </property>
        <property name="sizePolicy" >
         <sizepolicy>
-         <hsizetype>7</hsizetype>
-         <vsizetype>5</vsizetype>
+         <hsizetype>0</hsizetype>
+         <vsizetype>0</vsizetype>
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="lineWidth" >
-        <number>1</number>
+       <property name="layoutDirection" >
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="text" >
+        <string>...</string>
        </property>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QSplitter" name="splitter" >
+     <property name="sizePolicy" >
+      <sizepolicy>
+       <hsizetype>7</hsizetype>
+       <vsizetype>5</vsizetype>
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="lineWidth" >
+      <number>1</number>
+     </property>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <widget class="QTextBrowser" name="chatWidget" >
+      <property name="sizePolicy" >
+       <sizepolicy>
+        <hsizetype>7</hsizetype>
+        <vsizetype>5</vsizetype>
+        <horstretch>80</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+     </widget>
+     <widget class="QTreeWidget" name="nickTree" >
+      <property name="sizePolicy" >
+       <sizepolicy>
+        <hsizetype>3</hsizetype>
+        <vsizetype>5</vsizetype>
+        <horstretch>2</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="layoutDirection" >
+       <enum>Qt::LeftToRight</enum>
+      </property>
+      <property name="dragEnabled" >
+       <bool>true</bool>
+      </property>
+      <property name="textElideMode" >
+       <enum>Qt::ElideRight</enum>
+      </property>
+      <property name="sortingEnabled" >
+       <bool>false</bool>
+      </property>
+      <property name="animated" >
+       <bool>true</bool>
+      </property>
+      <property name="columnCount" >
+       <number>1</number>
+      </property>
+      <column>
+       <property name="text" >
+        <string>32 Users</string>
        </property>
-       <widget class="QTextBrowser" name="textBrowser" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>7</hsizetype>
-          <vsizetype>5</vsizetype>
-          <horstretch>80</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
+      </column>
+      <item>
+       <property name="text" >
+        <string>@ Operators</string>
+       </property>
+       <item>
+        <property name="text" >
+         <string>New Sub Item</string>
         </property>
-       </widget>
-       <widget class="QTreeWidget" name="treeWidget" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>3</hsizetype>
-          <vsizetype>5</vsizetype>
-          <horstretch>2</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
         </property>
-        <property name="layoutDirection" >
-         <enum>Qt::LeftToRight</enum>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
         </property>
-        <property name="dragEnabled" >
-         <bool>true</bool>
+       </item>
+      </item>
+      <item>
+       <property name="text" >
+        <string>4 Voiced</string>
+       </property>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
         </property>
-        <property name="textElideMode" >
-         <enum>Qt::ElideRight</enum>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
         </property>
-        <property name="columnCount" >
-         <number>1</number>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
         </property>
-        <column>
-         <property name="text" >
-          <string>32 Users</string>
-         </property>
-        </column>
-        <item>
-         <property name="text" >
-          <string>@ Operators</string>
-         </property>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>New Sub Item</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-        </item>
-        <item>
-         <property name="text" >
-          <string>4 Voiced</string>
-         </property>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-        </item>
-        <item>
-         <property name="text" >
-          <string>19 Users</string>
-         </property>
-         <item>
-          <property name="text" >
-           <string>New Sub Item</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>New Item</string>
-          </property>
-         </item>
-        </item>
-       </widget>
-      </widget>
-     </item>
-     <item>
-      <layout class="QHBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
+       </item>
+      </item>
+      <item>
+       <property name="text" >
+        <string>19 Users</string>
        </property>
        <item>
-        <widget class="QComboBox" name="comboBox" >
-         <item>
-          <property name="text" >
-           <string>mainNick</string>
-          </property>
-         </item>
-         <item>
-          <property name="text" >
-           <string>altNick</string>
-          </property>
-         </item>
-        </widget>
+        <property name="text" >
+         <string>New Sub Item</string>
+        </property>
        </item>
        <item>
-        <widget class="QLineEdit" name="lineEdit" />
+        <property name="text" >
+         <string>New Item</string>
+        </property>
        </item>
-      </layout>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
+        </property>
+       </item>
+      </item>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <item>
+      <widget class="QComboBox" name="ownNick" >
+       <item>
+        <property name="text" >
+         <string>mainNick</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>altNick</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="inputEdit" />
      </item>
     </layout>
    </item>
   </layout>
  </widget>
  <tabstops>
-  <tabstop>lineEdit_2</tabstop>
-  <tabstop>toolButton</tabstop>
+  <tabstop>topicEdit</tabstop>
+  <tabstop>chanSettingsButton</tabstop>
  </tabstops>
  <resources/>
  <connections/>
index db8de04..66b5754 100644 (file)
@@ -19,6 +19,7 @@
  ***************************************************************************/
 
 #include <QtGui>
+#include <QtCore>
 
 #include "global.h"
 
@@ -32,6 +33,13 @@ MainWin::MainWin() : QMainWindow() {
   setWindowTitle("Quassel IRC");
   setWindowIcon(QIcon(":/qirc-icon.png"));
   setWindowIconText("Quassel IRC");
+
+  QSettings s;
+  s.beginGroup("Geometry");
+  resize(s.value("MainWinSize", QSize(500, 400)).toSize());
+  move(s.value("MainWinPos", QPoint(50, 50)).toPoint());
+  s.endGroup();
+
   //workspace = new QWorkspace(this);
   //setCentralWidget(workspace);
   //ChannelWidget *cw = new ChannelWidget(this);
@@ -115,3 +123,16 @@ void MainWin::showServerList() {
   serverListDlg->show();
 }
 
+void MainWin::closeEvent(QCloseEvent *event)
+{
+  //if (userReallyWantsToQuit()) {
+    QSettings s;
+    s.beginGroup("Geometry");
+    s.setValue("MainWinSize", size());
+    s.setValue("MainWinPos", pos());
+    s.endGroup();
+    event->accept();
+  //} else {
+    //event->ignore();
+  //}
+}
index faaae57..9d7770f 100644 (file)
@@ -36,6 +36,7 @@ class MainWin : public QMainWindow {
     MainWin();
 
   protected:
+    void closeEvent(QCloseEvent *event);
 
   private slots:
     void showServerList();