[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.3/kdenetwork/kopete/protocols/gadu
From:       Matt Rogers <mattr () kde ! org>
Date:       2009-09-12 3:56:02
Message-ID: 1252727762.160828.8198.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1022578 by mattr:

Fix Gadu going offline when setting a status description

Patch by Jakub Grandys. Thanks!

BUG: 163541
This is the backport for the KDE 4.3 branch.

 M  +12 -6     gaduaway.cpp  
 M  +68 -114   ui/gaduawayui.ui  


--- branches/KDE/4.3/kdenetwork/kopete/protocols/gadu/gaduaway.cpp #1022577:1022578
@@ -29,7 +29,6 @@
 #include <ktextedit.h>
 #include <klocale.h>
 
-#include <q3buttongroup.h>
 #include <qradiobutton.h>
 #include <qlineedit.h>
 
@@ -49,18 +48,25 @@
 	ui_->setupUi( w );
 	setMainWidget( w );
 
+	ui_->buttonGroup_->setId(ui_->onlineButton_, GG_STATUS_AVAIL_DESCR);
+	ui_->buttonGroup_->setId(ui_->awayButton_, GG_STATUS_BUSY_DESCR);
+	ui_->buttonGroup_->setId(ui_->invisibleButton_, GG_STATUS_INVISIBLE_DESCR);
+	ui_->buttonGroup_->setId(ui_->offlineButton_, GG_STATUS_NOT_AVAIL_DESCR);
+	
+	
 	ks = account->myself()->onlineStatus();
 	s  = GaduProtocol::protocol()->statusToWithDescription( ks );
 
+
 	if ( s == GG_STATUS_NOT_AVAIL_DESCR ) {
-		ui_->statusGroup_->find( GG_STATUS_NOT_AVAIL_DESCR )->setDisabled( true );
-		ui_->statusGroup_->setButton( GG_STATUS_AVAIL_DESCR );
+		ui_->buttonGroup_->button( GG_STATUS_NOT_AVAIL_DESCR )->setDisabled( true );
+		ui_->buttonGroup_->button( GG_STATUS_AVAIL_DESCR)->setChecked(true);
 	}
 	else {
-		ui_->statusGroup_->setButton( s );
+		ui_->buttonGroup_->button( s )->setChecked(true);
 	}
 
-	ui_->textEdit_->setText( account->myself()->property( "awayMessage" \
).value().toString() ); +	ui_->textEdit_->setText( account->myself()->property( \
"statusMessage" ).value().toString() );  connect( this, SIGNAL( applyClicked() ), \
SLOT( slotApply() ) );  }
 
@@ -72,7 +78,7 @@
 int
 GaduAway::status() const
 {
-	return ui_->statusGroup_->id( ui_->statusGroup_->selected() );
+	return ui_->buttonGroup_->checkedId();
 }
 
 QString
--- branches/KDE/4.3/kdenetwork/kopete/protocols/gadu/ui/gaduawayui.ui \
#1022577:1022578 @@ -1,155 +1,123 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>GaduAwayUI</class>
- <widget class="QWidget" name="GaduAwayUI" >
-  <property name="geometry" >
+ <widget class="QWidget" name="GaduAwayUI">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>332</width>
-    <height>188</height>
+    <height>200</height>
    </rect>
   </property>
-  <property name="focusPolicy" >
+  <property name="focusPolicy">
    <enum>Qt::TabFocus</enum>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Away Dialog</string>
   </property>
-  <layout class="QGridLayout" >
-   <property name="leftMargin" >
+  <layout class="QGridLayout">
+   <property name="margin">
     <number>0</number>
    </property>
-   <property name="topMargin" >
-    <number>0</number>
-   </property>
-   <property name="rightMargin" >
-    <number>0</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>0</number>
-   </property>
-   <property name="horizontalSpacing" >
+   <property name="spacing">
     <number>6</number>
    </property>
-   <property name="verticalSpacing" >
-    <number>6</number>
-   </property>
-   <item row="0" column="0" >
-    <layout class="QVBoxLayout" >
-     <property name="spacing" >
+   <item row="0" column="0">
+    <layout class="QVBoxLayout">
+     <property name="spacing">
       <number>6</number>
      </property>
-     <property name="leftMargin" >
+     <property name="margin">
       <number>0</number>
      </property>
-     <property name="topMargin" >
-      <number>0</number>
-     </property>
-     <property name="rightMargin" >
-      <number>0</number>
-     </property>
-     <property name="bottomMargin" >
-      <number>0</number>
-     </property>
      <item>
-      <widget class="Q3ButtonGroup" name="statusGroup_" >
-       <property name="whatsThis" >
+      <widget class="QGroupBox" name="statusGroup_">
+       <property name="whatsThis">
         <string>Choose a status; by default Online status is selected. 
 So all you need to do is just to type in your description. 
 Choosing Offline status will disconnect you, with given description.</string>
        </property>
-       <property name="title" >
+       <property name="title">
         <string>Status</string>
        </property>
-       <property name="orientation" >
-        <enum>Qt::Vertical</enum>
-       </property>
-       <layout class="QGridLayout" >
-        <property name="leftMargin" >
+       <layout class="QGridLayout">
+        <property name="margin">
          <number>11</number>
         </property>
-        <property name="topMargin" >
-         <number>11</number>
-        </property>
-        <property name="rightMargin" >
-         <number>11</number>
-        </property>
-        <property name="bottomMargin" >
-         <number>11</number>
-        </property>
-        <property name="horizontalSpacing" >
+        <property name="spacing">
          <number>6</number>
         </property>
-        <property name="verticalSpacing" >
-         <number>6</number>
-        </property>
-        <item row="0" column="0" >
-         <layout class="QVBoxLayout" >
-          <property name="spacing" >
+        <item row="0" column="0">
+         <layout class="QVBoxLayout">
+          <property name="spacing">
            <number>6</number>
           </property>
-          <property name="leftMargin" >
+          <property name="margin">
            <number>0</number>
           </property>
-          <property name="topMargin" >
-           <number>0</number>
-          </property>
-          <property name="rightMargin" >
-           <number>0</number>
-          </property>
-          <property name="bottomMargin" >
-           <number>0</number>
-          </property>
           <item>
-           <widget class="QRadioButton" name="onlineButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="onlineButton_">
+            <property name="toolTip">
              <string>Set your status to Online.</string>
             </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Set your status to Online, indicating that you are available to \
chat with anyone who wishes.</string>  </property>
-            <property name="text" >
+            <property name="text">
              <string>O&amp;nline</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
           <item>
-           <widget class="QRadioButton" name="awayButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="awayButton_">
+            <property name="toolTip">
              <string>Set your status to busy.</string>
             </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Set your status to busy, indicating that you should not be \
bothered with trivial chat, and may not be able to reply immediately.</string>  \
                </property>
-            <property name="text" >
+            <property name="text">
              <string>&amp;Busy</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
           <item>
-           <widget class="QRadioButton" name="invisibleButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="invisibleButton_">
+            <property name="toolTip">
              <string>Set status to invisible, which will hide your presence from \
other users.</string>  </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Set status to invisible, which will hide your presence from \
other users (who will see you as offline).  However you may still chat, and see the \
online presence of others.</string>  </property>
-            <property name="text" >
+            <property name="text">
              <string>&amp;Invisible</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
           <item>
-           <widget class="QRadioButton" name="offlineButton_" >
-            <property name="toolTip" >
+           <widget class="QRadioButton" name="offlineButton_">
+            <property name="toolTip">
              <string>Choose this status to disconnect with the description entered \
below.</string>  </property>
-            <property name="whatsThis" >
+            <property name="whatsThis">
              <string>Choose this status to disconnect with the description entered \
below.</string>  </property>
-            <property name="text" >
+            <property name="text">
              <string>O&amp;ffline</string>
             </property>
+            <attribute name="buttonGroup">
+             <string>buttonGroup_</string>
+            </attribute>
            </widget>
           </item>
          </layout>
@@ -158,50 +126,41 @@
       </widget>
      </item>
      <item>
-      <layout class="QHBoxLayout" >
-       <property name="spacing" >
+      <layout class="QHBoxLayout">
+       <property name="spacing">
         <number>6</number>
        </property>
-       <property name="leftMargin" >
+       <property name="margin">
         <number>0</number>
        </property>
-       <property name="topMargin" >
-        <number>0</number>
-       </property>
-       <property name="rightMargin" >
-        <number>0</number>
-       </property>
-       <property name="bottomMargin" >
-        <number>0</number>
-       </property>
        <item>
-        <widget class="QLabel" name="textLabel3" >
-         <property name="toolTip" >
+        <widget class="QLabel" name="textLabel3">
+         <property name="toolTip">
           <string>Description of your status.</string>
          </property>
-         <property name="whatsThis" >
+         <property name="whatsThis">
           <string>Description of your status (up to 70 characters).</string>
          </property>
-         <property name="text" >
+         <property name="text">
           <string>&amp;Message:</string>
          </property>
-         <property name="buddy" >
+         <property name="buddy">
           <cstring>textEdit_</cstring>
          </property>
         </widget>
        </item>
        <item>
-        <widget class="QLineEdit" name="textEdit_" >
-         <property name="acceptDrops" >
+        <widget class="QLineEdit" name="textEdit_">
+         <property name="acceptDrops">
           <bool>false</bool>
          </property>
-         <property name="toolTip" >
+         <property name="toolTip">
           <string>Description of your status.</string>
          </property>
-         <property name="whatsThis" >
+         <property name="whatsThis">
           <string>Description of your status (up to 70 characters).</string>
          </property>
-         <property name="maxLength" >
+         <property name="maxLength">
           <number>70</number>
          </property>
         </widget>
@@ -212,14 +171,6 @@
    </item>
   </layout>
  </widget>
- <customwidgets>
-  <customwidget>
-   <class>Q3ButtonGroup</class>
-   <extends>Q3GroupBox</extends>
-   <header>Qt3Support/Q3ButtonGroup</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
  <tabstops>
   <tabstop>onlineButton_</tabstop>
   <tabstop>awayButton_</tabstop>
@@ -229,4 +180,7 @@
  </tabstops>
  <resources/>
  <connections/>
+ <buttongroups>
+  <buttongroup name="buttonGroup_"/>
+ </buttongroups>
 </ui>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic