removing nickview color settings
authorMarcus Eggenberger <egs@quassel-irc.org>
Sun, 1 Feb 2009 16:52:01 +0000 (17:52 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Sun, 1 Feb 2009 16:52:01 +0000 (17:52 +0100)
src/qtui/settingspages/colorsettingspage.cpp
src/qtui/settingspages/colorsettingspage.h
src/qtui/settingspages/colorsettingspage.ui
src/uisupport/bufferview.cpp

index 2d5c3ba..a301bd8 100644 (file)
@@ -46,7 +46,8 @@ ColorSettingsPage::ColorSettingsPage(QWidget *parent)
 
   connect(mapper, SIGNAL(mapped(QWidget *)), this, SLOT(chooseColor(QWidget *)));
 
 
   connect(mapper, SIGNAL(mapped(QWidget *)), this, SLOT(chooseColor(QWidget *)));
 
-  //disable unused buttons:
+
+  
 #ifndef PHONDEV
   ui.inactiveActivityUseBG->setEnabled(false);
   ui.noActivityUseBG->setEnabled(false);
 #ifndef PHONDEV
   ui.inactiveActivityUseBG->setEnabled(false);
   ui.noActivityUseBG->setEnabled(false);
@@ -64,9 +65,6 @@ ColorSettingsPage::ColorSettingsPage(QWidget *parent)
   ui.modeFlagsUseBG->setEnabled(false);
   ui.urlFG->setEnabled(false);
   ui.urlUseBG->setEnabled(false);
   ui.modeFlagsUseBG->setEnabled(false);
   ui.urlFG->setEnabled(false);
   ui.urlUseBG->setEnabled(false);
-
-  ui.onlineStatusUseBG->setEnabled(false);
-  ui.awayStatusUseBG->setEnabled(false);
 #endif
 }
 
 #endif
 }
 
@@ -80,7 +78,6 @@ void ColorSettingsPage::defaults() {
   defaultUserActivity();
   defaultMessage();
   defaultMircColorCodes();
   defaultUserActivity();
   defaultMessage();
   defaultMircColorCodes();
-  defaultNickview();
 
   widgetHasChanged();
   bufferviewPreview();
 
   widgetHasChanged();
   bufferviewPreview();
@@ -215,17 +212,6 @@ void ColorSettingsPage::defaultMircColorCodes() {
   ui.color15->setColor(QtUi::style()->format(UiStyle::FgCol15, Settings::Default).foreground().color());
 }
 
   ui.color15->setColor(QtUi::style()->format(UiStyle::FgCol15, Settings::Default).foreground().color());
 }
 
-void ColorSettingsPage::defaultNickview() {
-  ui.onlineStatusFG->setColor(QColor(Qt::black));
-  ui.onlineStatusBG->setColor(QColor("white"));
-  ui.onlineStatusBG->setEnabled(false);
-  ui.onlineStatusUseBG->setChecked(false);
-  ui.awayStatusFG->setColor(QColor(Qt::gray));
-  ui.awayStatusBG->setColor(QColor("white"));
-  ui.awayStatusBG->setEnabled(false);
-  ui.awayStatusUseBG->setChecked(false);
-}
-
 void ColorSettingsPage::load() {
   QtUiStyleSettings s("Colors");
   settings["InactiveActivityFG"] = s.value("inactiveActivityFG", QVariant(QColor(Qt::gray)));
 void ColorSettingsPage::load() {
   QtUiStyleSettings s("Colors");
   settings["InactiveActivityFG"] = s.value("inactiveActivityFG", QVariant(QColor(Qt::gray)));
@@ -392,20 +378,6 @@ void ColorSettingsPage::load() {
   ui.color14->setColor(QtUi::style()->format(UiStyle::FgCol14).foreground().color());
   ui.color15->setColor(QtUi::style()->format(UiStyle::FgCol15).foreground().color());
 
   ui.color14->setColor(QtUi::style()->format(UiStyle::FgCol14).foreground().color());
   ui.color15->setColor(QtUi::style()->format(UiStyle::FgCol15).foreground().color());
 
-  settings["OnlineStatusFG"] = s.value("onlineStatusFG", QVariant(QColor(Qt::black)));
-  ui.onlineStatusFG->setColor(settings["OnlineStatusFG"].value<QColor>());
-  settings["OnlineStatusBG"] = s.value("onlineStatusBG", QVariant(QColor(Qt::white)));
-  ui.onlineStatusBG->setColor(settings["OnlineStatusBG"].value<QColor>());
-  settings["OnlineStatusUseBG"] = s.value("onlineStatusUseBG");
-  ui.onlineStatusUseBG->setChecked(settings["OnlineStatusUseBG"].toBool());
-
-  settings["AwayStatusFG"] = s.value("awayStatusFG", QVariant(QColor(Qt::gray)));
-  ui.awayStatusFG->setColor(settings["AwayStatusFG"].value<QColor>());
-  settings["AwayStatusBG"] = s.value("awayStatusBG", QVariant(QColor(Qt::white)));
-  ui.awayStatusBG->setColor(settings["AwayStatusBG"].value<QColor>());
-  settings["AwayStatusUseBG"] = s.value("awayStatusUseBG");
-  ui.awayStatusUseBG->setChecked(settings["AwayStatusUseBG"].toBool());
-
   setChangedState(false);
   bufferviewPreview();
   chatviewPreview();
   setChangedState(false);
   bufferviewPreview();
   chatviewPreview();
@@ -492,13 +464,6 @@ void ColorSettingsPage::save() {
   saveMircColor(14, ui.color14->color());
   saveMircColor(15, ui.color15->color());
 
   saveMircColor(14, ui.color14->color());
   saveMircColor(15, ui.color15->color());
 
-  s.setValue("onlineStatusFG", ui.onlineStatusFG->color());
-  s.setValue("onlineStatusBG", ui.onlineStatusBG->color());
-  s.setValue("onlineStatusUseBG", ui.onlineStatusUseBG->isChecked());
-  s.setValue("awayStatusFG", ui.awayStatusFG->color());
-  s.setValue("awayStatusBG", ui.awayStatusBG->color());
-  s.setValue("awayStatusUseBG", ui.awayStatusUseBG->isChecked());
-
   load(); //TODO: remove when settings hash map is unnescessary
   setChangedState(false);
 }
   load(); //TODO: remove when settings hash map is unnescessary
   setChangedState(false);
 }
@@ -627,13 +592,6 @@ bool ColorSettingsPage::testHasChanged() {
   if(QtUi::style()->format(UiStyle::FgCol14).foreground().color() != ui.color14->color()) return true;
   if(QtUi::style()->format(UiStyle::FgCol15).foreground().color() != ui.color15->color()) return true;
 
   if(QtUi::style()->format(UiStyle::FgCol14).foreground().color() != ui.color14->color()) return true;
   if(QtUi::style()->format(UiStyle::FgCol15).foreground().color() != ui.color15->color()) return true;
 
-  if(settings["OnlineStatusFG"].value<QColor>() != ui.onlineStatusFG->color()) return true;
-  if(settings["OnlineStatusBG"].value<QColor>() != ui.onlineStatusBG->color()) return true;
-  if(settings["OnlineStatusUseBG"].toBool() != ui.onlineStatusUseBG->isChecked()) return true;
-  if(settings["AwayStatusFG"].value<QColor>() != ui.awayStatusFG->color()) return true;
-  if(settings["AwayStatusBG"].value<QColor>() != ui.awayStatusBG->color()) return true;
-  if(settings["AwayStatusUseBG"].toBool() != ui.awayStatusUseBG->isChecked()) return true;
-
   return false;
 }
 
   return false;
 }
 
index a89190d..ac1445d 100644 (file)
@@ -47,7 +47,6 @@ class ColorSettingsPage : public SettingsPage {
     void defaultUserActivity();
     void defaultMessage();
     void defaultMircColorCodes();
     void defaultUserActivity();
     void defaultMessage();
     void defaultMircColorCodes();
-    void defaultNickview();
 
   private slots:
     void widgetHasChanged();
 
   private slots:
     void widgetHasChanged();
index 99f3ff8..f877254 100644 (file)
       <number>0</number>
      </property>
      <widget class="QWidget" name="bufferview" >
       <number>0</number>
      </property>
      <widget class="QWidget" name="bufferview" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>487</width>
+        <height>485</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>Bufferview</string>
       </attribute>
       <attribute name="title" >
        <string>Bufferview</string>
       </attribute>
       </layout>
      </widget>
      <widget class="QWidget" name="chatview" >
       </layout>
      </widget>
      <widget class="QWidget" name="chatview" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>487</width>
+        <height>485</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>Chatview</string>
       </attribute>
       <attribute name="title" >
        <string>Chatview</string>
       </attribute>
           <number>0</number>
          </property>
          <widget class="QWidget" name="tab" >
           <number>0</number>
          </property>
          <widget class="QWidget" name="tab" >
+          <property name="geometry" >
+           <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>441</width>
+            <height>294</height>
+           </rect>
+          </property>
           <attribute name="title" >
            <string>Server Activity</string>
           </attribute>
           <attribute name="title" >
            <string>Server Activity</string>
           </attribute>
           </layout>
          </widget>
          <widget class="QWidget" name="tab_2" >
           </layout>
          </widget>
          <widget class="QWidget" name="tab_2" >
+          <property name="geometry" >
+           <rect>
+            <x>360</x>
+            <y>270</y>
+            <width>720</width>
+            <height>360</height>
+           </rect>
+          </property>
           <attribute name="title" >
            <string>User Activity</string>
           </attribute>
           <attribute name="title" >
            <string>User Activity</string>
           </attribute>
           </layout>
          </widget>
          <widget class="QWidget" name="Seite_2" >
           </layout>
          </widget>
          <widget class="QWidget" name="Seite_2" >
+          <property name="geometry" >
+           <rect>
+            <x>360</x>
+            <y>270</y>
+            <width>720</width>
+            <height>360</height>
+           </rect>
+          </property>
           <attribute name="title" >
            <string>Message</string>
           </attribute>
           <attribute name="title" >
            <string>Message</string>
           </attribute>
       </layout>
      </widget>
      <widget class="QWidget" name="Mirc" >
       </layout>
      </widget>
      <widget class="QWidget" name="Mirc" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>487</width>
+        <height>485</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>Mirc Color Codes</string>
       </attribute>
       <attribute name="title" >
        <string>Mirc Color Codes</string>
       </attribute>
        </item>
       </layout>
      </widget>
        </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="nickview" >
-      <attribute name="title" >
-       <string>Nickview</string>
-      </attribute>
-      <layout class="QGridLayout" >
-       <item row="0" column="0" >
-        <widget class="QGroupBox" name="groupBox_8" >
-         <property name="title" >
-          <string>Nick status:</string>
-         </property>
-         <layout class="QGridLayout" >
-          <item row="0" column="1" >
-           <widget class="QLabel" name="label_4" >
-            <property name="text" >
-             <string>FG</string>
-            </property>
-            <property name="alignment" >
-             <set>Qt::AlignCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item row="0" column="2" >
-           <widget class="QLabel" name="label_5" >
-            <property name="text" >
-             <string>BG</string>
-            </property>
-            <property name="alignment" >
-             <set>Qt::AlignCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item row="0" column="3" >
-           <widget class="QLabel" name="label_6" >
-            <property name="text" >
-             <string>Use BG</string>
-            </property>
-            <property name="alignment" >
-             <set>Qt::AlignCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="0" >
-           <widget class="QLabel" name="label_62" >
-            <property name="text" >
-             <string>Online:</string>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="1" >
-           <widget class="ColorButton" name="onlineStatusFG" >
-            <property name="text" >
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="2" >
-           <widget class="ColorButton" name="onlineStatusBG" >
-            <property name="enabled" >
-             <bool>false</bool>
-            </property>
-            <property name="text" >
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="3" >
-           <widget class="QCheckBox" name="onlineStatusUseBG" >
-            <property name="sizePolicy" >
-             <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="layoutDirection" >
-             <enum>Qt::LeftToRight</enum>
-            </property>
-            <property name="text" >
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item row="2" column="0" >
-           <widget class="QLabel" name="label_63" >
-            <property name="text" >
-             <string>Away:</string>
-            </property>
-           </widget>
-          </item>
-          <item row="2" column="1" >
-           <widget class="ColorButton" name="awayStatusFG" >
-            <property name="text" >
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item row="2" column="2" >
-           <widget class="ColorButton" name="awayStatusBG" >
-            <property name="enabled" >
-             <bool>false</bool>
-            </property>
-            <property name="text" >
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item row="2" column="3" >
-           <widget class="QCheckBox" name="awayStatusUseBG" >
-            <property name="sizePolicy" >
-             <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="text" >
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item row="3" column="0" >
-           <spacer>
-            <property name="orientation" >
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="sizeHint" stdset="0" >
-             <size>
-              <width>20</width>
-              <height>40</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item row="0" column="1" >
-        <widget class="QGroupBox" name="groupBox_9" >
-         <property name="title" >
-          <string>Preview:</string>
-         </property>
-         <layout class="QVBoxLayout" >
-          <item>
-           <widget class="QTreeWidget" name="nickviewPreview" >
-            <column>
-             <property name="text" >
-              <string>1</string>
-             </property>
-            </column>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item row="1" column="0" colspan="2" >
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0" >
-          <size>
-           <width>261</width>
-           <height>151</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
     </widget>
    </item>
   </layout>
     </widget>
    </item>
   </layout>
     </hint>
    </hints>
   </connection>
     </hint>
    </hints>
   </connection>
-  <connection>
-   <sender>onlineStatusUseBG</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>onlineStatusBG</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>202</x>
-     <y>111</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>150</x>
-     <y>111</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>awayStatusUseBG</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>awayStatusBG</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>202</x>
-     <y>147</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>150</x>
-     <y>147</y>
-    </hint>
-   </hints>
-  </connection>
   <connection>
    <sender>errorMessageUseBG</sender>
    <signal>clicked(bool)</signal>
   <connection>
    <sender>errorMessageUseBG</sender>
    <signal>clicked(bool)</signal>
index 51d5ddf..0b33869 100644 (file)
@@ -56,8 +56,8 @@ BufferView::BufferView(QWidget *parent)
   setSelectionMode(QAbstractItemView::ExtendedSelection);
 
   QAbstractItemDelegate *oldDelegate = itemDelegate();
   setSelectionMode(QAbstractItemView::ExtendedSelection);
 
   QAbstractItemDelegate *oldDelegate = itemDelegate();
-  BufferViewDelegate *tristateDelegate = new BufferViewDelegate(this);
-  setItemDelegate(tristateDelegate);
+  BufferViewDelegate *newDelegate = new BufferViewDelegate(this);
+  setItemDelegate(newDelegate);
   delete oldDelegate;
 }
 
   delete oldDelegate;
 }