More small changes, working on the dialogs right now.
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 21 Oct 2006 15:35:54 +0000 (15:35 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 21 Oct 2006 15:35:54 +0000 (15:35 +0000)
CMakeLists.txt
gui/identitiesdlg.ui
gui/identitieseditdlg.ui
gui/mainwin.cpp
gui/networkeditdlg.ui
gui/nickeditdlg.ui
gui/serverlist.cpp

index 58a6b95..eaf8be0 100644 (file)
@@ -39,6 +39,7 @@ ENDFOREACH(dir)
 INCLUDE_DIRECTORIES(${SDIRS})
 
 # We need Qt4 support.
+SET(QT_MIN_VERSION "4.2.0") 
 FIND_PACKAGE(Qt4 REQUIRED)
 
 # Set needed libraries
index d994b8a..a05a8af 100644 (file)
@@ -1,15 +1,12 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>IdentitiesDlg</class>
  <widget class="QDialog" name="IdentitiesDlg" >
   <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>383</width>
-    <height>390</height>
+    <width>454</width>
+    <height>442</height>
    </rect>
   </property>
   <property name="sizePolicy" >
@@ -73,6 +70,9 @@
    </item>
    <item>
     <widget class="QTabWidget" name="tabWidget" >
+     <property name="currentIndex" >
+      <number>0</number>
+     </property>
      <widget class="QWidget" name="generalTab" >
       <attribute name="title" >
        <string>&amp;General</string>
         </widget>
        </item>
       </layout>
-      <widget class="QWidget" name="widget" >
+      <widget class="QWidget" native="1" name="widget" >
        <property name="geometry" >
         <rect>
          <x>10</x>
     </widget>
    </item>
    <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
+    <widget class="QDialogButtonBox" name="buttonBox" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
      </property>
-     <property name="spacing" >
-      <number>6</number>
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
      </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>131</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="text" >
-        <string>OK</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../images/icons.qrc" >:/default/button_ok.png</iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="text" >
-        <string>Cancel</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../images/icons.qrc" >:/default/button_cancel.png</iconset>
-       </property>
-      </widget>
-     </item>
-    </layout>
+    </widget>
    </item>
   </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
  <resources>
   <include location="../images/icons.qrc" />
  </resources>
  <connections>
-  <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
-   <receiver>IdentitiesDlg</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>356</x>
-     <y>372</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
-   <receiver>IdentitiesDlg</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>447</x>
-     <y>372</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>179</x>
-     <y>282</y>
-    </hint>
-   </hints>
-  </connection>
   <connection>
    <sender>enableAwayNick</sender>
    <signal>clicked(bool)</signal>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>IdentitiesDlg</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>226</x>
+     <y>420</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>226</x>
+     <y>220</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>IdentitiesDlg</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>226</x>
+     <y>420</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>226</x>
+     <y>220</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>
index 9835e43..05714b8 100644 (file)
@@ -1,7 +1,4 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>IdentitiesEditDlg</class>
  <widget class="QDialog" name="IdentitiesEditDlg" >
   <property name="geometry" >
     </layout>
    </item>
    <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
+    <widget class="QDialogButtonBox" name="buttonBox" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
      </property>
-     <property name="spacing" >
-      <number>6</number>
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
      </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>131</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="text" >
-        <string>&amp;OK</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="text" >
-        <string>&amp;Cancel</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
+    </widget>
    </item>
   </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
  <resources/>
  <connections>
   <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
    <receiver>IdentitiesEditDlg</receiver>
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>278</x>
-     <y>253</y>
+     <x>190</x>
+     <y>213</y>
     </hint>
     <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
+     <x>190</x>
+     <y>117</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
    <receiver>IdentitiesEditDlg</receiver>
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>369</x>
-     <y>253</y>
+     <x>190</x>
+     <y>213</y>
     </hint>
     <hint type="destinationlabel" >
-     <x>179</x>
-     <y>282</y>
+     <x>190</x>
+     <y>117</y>
     </hint>
    </hints>
   </connection>
index 49196f8..3faaf10 100644 (file)
@@ -61,6 +61,8 @@ MainWin::MainWin() : QMainWindow() {
   cw->showMaximized();
   //setEnabled(true);
   statusBar()->showMessage(tr("Ready."));
+  //QSystemTrayIcon *systray = new QSystemTrayIcon(QIcon(":/qirc-icon.png"));
+  //systray->showMessage("Quassel", "Started!");
 }
 
 void MainWin::syncToCore() {
index 3b1b5be..6814051 100644 (file)
@@ -1,7 +1,4 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>NetworkEditDlg</class>
  <widget class="QDialog" name="NetworkEditDlg" >
   <property name="geometry" >
@@ -17,7 +14,7 @@
   </property>
   <layout class="QVBoxLayout" >
    <property name="margin" >
-    <number>8</number>
+    <number>9</number>
    </property>
    <property name="spacing" >
     <number>6</number>
      </property>
     </widget>
    </item>
+   <item>
+    <widget class="QWidget" native="1" name="widget" />
+   </item>
    <item>
     <widget class="QTabWidget" name="tabWidget" >
+     <property name="currentIndex" >
+      <number>0</number>
+     </property>
      <widget class="QWidget" name="tab" >
       <attribute name="title" >
        <string>Servers</string>
         </layout>
        </item>
       </layout>
-      <widget class="QWidget" name="" >
+      <widget class="QWidget" native="1" name="widget" >
        <property name="geometry" >
         <rect>
          <x>230</x>
     </widget>
    </item>
    <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
+    <widget class="QWidget" native="1" name="layoutWidget" />
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
      </property>
-     <property name="spacing" >
-      <number>6</number>
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
      </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>275</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="text" >
-        <string>OK</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="text" >
-        <string>Cancel</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
+    </widget>
    </item>
   </layout>
-  <widget class="QWidget" name="" >
-   <property name="geometry" >
-    <rect>
-     <x>10</x>
-     <y>110</y>
-     <width>461</width>
-     <height>331</height>
-    </rect>
-   </property>
-  </widget>
-  <widget class="QWidget" name="layoutWidget" >
-   <property name="geometry" >
-    <rect>
-     <x>11</x>
-     <y>407</y>
-     <width>459</width>
-     <height>33</height>
-    </rect>
-   </property>
-  </widget>
  </widget>
- <pixmapfunction></pixmapfunction>
  <resources/>
  <connections>
   <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
    <receiver>NetworkEditDlg</receiver>
-   <slot>accept()</slot>
+   <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>278</x>
-     <y>253</y>
+     <x>216</x>
+     <y>435</y>
     </hint>
     <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
+     <x>216</x>
+     <y>228</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
    <receiver>NetworkEditDlg</receiver>
-   <slot>reject()</slot>
+   <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>369</x>
-     <y>253</y>
+     <x>216</x>
+     <y>435</y>
     </hint>
     <hint type="destinationlabel" >
-     <x>179</x>
-     <y>282</y>
+     <x>216</x>
+     <y>228</y>
     </hint>
    </hints>
   </connection>
index 01deb7f..fbd82ca 100644 (file)
@@ -1,7 +1,4 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>NickEditDlg</class>
  <widget class="QDialog" name="NickEditDlg" >
   <property name="geometry" >
@@ -28,7 +25,7 @@
   </property>
   <layout class="QVBoxLayout" >
    <property name="margin" >
-    <number>8</number>
+    <number>9</number>
    </property>
    <property name="spacing" >
     <number>6</number>
@@ -43,6 +40,9 @@
    <item>
     <widget class="QLineEdit" name="lineEdit" />
    </item>
+   <item>
+    <widget class="QWidget" native="1" name="widget" />
+   </item>
    <item>
     <spacer>
      <property name="orientation" >
      </property>
      <property name="sizeHint" >
       <size>
-       <width>20</width>
-       <height>40</height>
+       <width>291</width>
+       <height>16</height>
       </size>
      </property>
     </spacer>
    </item>
    <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
+    <widget class="QDialogButtonBox" name="buttonBox" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
      </property>
-     <property name="spacing" >
-      <number>6</number>
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
      </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>131</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="text" >
-        <string>OK</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="text" >
-        <string>Cancel</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
+    </widget>
    </item>
   </layout>
-  <widget class="QWidget" name="" >
-   <property name="geometry" >
-    <rect>
-     <x>9</x>
-     <y>32</y>
-     <width>325</width>
-     <height>25</height>
-    </rect>
-   </property>
-  </widget>
  </widget>
- <pixmapfunction></pixmapfunction>
  <resources/>
  <connections>
   <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
    <receiver>NickEditDlg</receiver>
-   <slot>accept()</slot>
+   <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>278</x>
-     <y>253</y>
+     <x>153</x>
+     <y>77</y>
     </hint>
     <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
+     <x>153</x>
+     <y>47</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
    <receiver>NickEditDlg</receiver>
-   <slot>reject()</slot>
+   <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>369</x>
-     <y>253</y>
+     <x>153</x>
+     <y>77</y>
     </hint>
     <hint type="destinationlabel" >
-     <x>179</x>
-     <y>282</y>
+     <x>153</x>
+     <y>47</y>
     </hint>
    </hints>
   </connection>
index 3053bfb..8dbb4a1 100644 (file)
@@ -321,7 +321,8 @@ void IdentitiesDlg::autoAwayChecked() {
 }
 
 void IdentitiesDlg::nickSelectionChanged() {
-  int curidx = ui.nickList->currentRow();
+  Q_ASSERT(ui.nickList->selectedItems().size() == 1);
+  int curidx = ui.nickList->row(ui.nickList->selectedItems()[0]);
   ui.editNickButton->setEnabled(curidx >= 0);
   ui.delNickButton->setEnabled(curidx >= 0);
   ui.upNickButton->setEnabled(curidx > 0);
@@ -444,11 +445,11 @@ IdentitiesEditDlg::IdentitiesEditDlg(QWidget *parent, VarMap _identities, QMap<Q
 }
 
 void IdentitiesEditDlg::selectionChanged() {
-  int idx = ui.identList->currentRow();
+  Q_ASSERT(ui.identList->selectedItems().size() == 1);
+  int idx = ui.identList->row(ui.identList->selectedItems()[0]);
   ui.duplicateButton->setEnabled(idx >= 0);
   ui.renameButton->setEnabled(idx > 0);
   ui.deleteButton->setEnabled(idx > 0);
-
 }
 
 void IdentitiesEditDlg::addIdentity() {
@@ -534,7 +535,7 @@ NickEditDlg::NickEditDlg(QWidget *parent, QString nick) : QDialog(parent) {
 }
 
 void NickEditDlg::textChanged(QString text) {
-  ui.okButton->setDisabled(text.isEmpty() || text == "");
+  ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(text.isEmpty() || text == "");
 }
 
 QString NickEditDlg::getNick() {
@@ -546,7 +547,7 @@ QString NickEditDlg::getNick() {
 RenameIdentityDlg::RenameIdentityDlg(QWidget *parent, QList<QString> _reserved, QString name) : QDialog(parent) {
   ui.setupUi(this);
   reserved = _reserved;
-  //ui.NickEditDlg->setWindowTitle(tr("Edit Identity Name"));  // why does this not work?
+  setWindowTitle(tr("Edit Identity Name"));
   ui.label->setText(tr("Identity:"));
   ui.lineEdit->setText(name);
   connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)));
@@ -554,8 +555,8 @@ RenameIdentityDlg::RenameIdentityDlg(QWidget *parent, QList<QString> _reserved,
 }
 
 void RenameIdentityDlg::textChanged(QString text) {
-  if(text.length() == 0) { ui.okButton->setEnabled(0); return; }
-  ui.okButton->setDisabled(reserved.contains(text));
+  if(text.length() == 0) { ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true); return; }
+  ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(reserved.contains(text));
 }
 
 QString RenameIdentityDlg::getName() {