[rkward-cvs] SF.net SVN: rkward-code:[4842] trunk/rkward/rkward/plugin

tfry at users.sf.net tfry at users.sf.net
Mon Sep 22 15:36:00 UTC 2014


Revision: 4842
          http://sourceforge.net/p/rkward/code/4842
Author:   tfry
Date:     2014-09-22 15:35:59 +0000 (Mon, 22 Sep 2014)
Log Message:
-----------
Make some labels optional (hiding them if empty)

Modified Paths:
--------------
    trunk/rkward/rkward/plugin/rkinput.cpp
    trunk/rkward/rkward/plugin/rkvalueselector.cpp
    trunk/rkward/rkward/plugin/rkvarslot.cpp

Modified: trunk/rkward/rkward/plugin/rkinput.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkinput.cpp	2014-09-22 15:35:16 UTC (rev 4841)
+++ trunk/rkward/rkward/plugin/rkinput.cpp	2014-09-22 15:35:59 UTC (rev 4842)
@@ -2,7 +2,7 @@
                           rkinput  -  description
                              -------------------
     begin                : Sat Mar 10 2005
-    copyright            : (C) 2005, 2006, 2007, 2012 by Thomas Friedrichsmeier
+    copyright            : (C) 2005, 2006, 2007, 2012, 2014 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -47,8 +47,11 @@
 	// do all the layouting
 	QVBoxLayout *vbox = new QVBoxLayout (this);
 	vbox->setContentsMargins (0, 0, 0, 0);
-	QLabel *label = new QLabel (xml->getStringAttribute (element, "label", i18n ("Enter text"), DL_INFO), this);
-	vbox->addWidget (label);
+	QString label_string = xml->getStringAttribute (element, "label", i18n ("Enter text"), DL_INFO);
+	if (!label_string.isEmpty ()) {
+		QLabel *label = new QLabel (label_string, this);
+		vbox->addWidget (label);
+	}
 
 	int size = xml->getMultiChoiceAttribute (element, "size", "small;medium;large", 1, DL_INFO);
 	if (size == 2) {

Modified: trunk/rkward/rkward/plugin/rkvalueselector.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkvalueselector.cpp	2014-09-22 15:35:16 UTC (rev 4841)
+++ trunk/rkward/rkward/plugin/rkvalueselector.cpp	2014-09-22 15:35:59 UTC (rev 4842)
@@ -2,7 +2,7 @@
                           rkvalueselector  -  description
                              -------------------
     begin                : Weg May 8 2013
-    copyright            : (C) 2013 by Thomas Friedrichsmeier
+    copyright            : (C) 2013, 2014 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 

Modified: trunk/rkward/rkward/plugin/rkvarslot.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkvarslot.cpp	2014-09-22 15:35:16 UTC (rev 4841)
+++ trunk/rkward/rkward/plugin/rkvarslot.cpp	2014-09-22 15:35:59 UTC (rev 4842)
@@ -2,7 +2,7 @@
                           rkvarslot.cpp  -  description
                              -------------------
     begin                : Thu Nov 7 2002
-    copyright            : (C) 2002-2013 by Thomas Friedrichsmeier
+    copyright            : (C) 2002-2014 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -42,8 +42,11 @@
 	// basic layout
 	QGridLayout *g_layout = new QGridLayout (this);
 
-	QLabel *label = new QLabel (xml->getStringAttribute (element, "label", i18n ("Variable:"), DL_INFO), this);
-	g_layout->addWidget (label, 0, 2);
+	QString label_string = xml->getStringAttribute (element, "label", i18n ("Variable:"), DL_INFO);
+	if (!label_string.isEmpty ()) {
+		QLabel *label = new QLabel (label_string, this);
+		g_layout->addWidget (label, 0, 2);
+	}
 
 	select = new QPushButton (QString::null, this);
 	setSelectButton (false);





More information about the rkward-tracker mailing list