[PC-BSD Commits] r17673 - in pcbsd/current/src-qt4/qsu: resources/icons src

svn at pcbsd.org svn at pcbsd.org
Fri Jul 6 11:16:50 PDT 2012


Author: gamaral
Date: 2012-07-06 18:16:50 +0000 (Fri, 06 Jul 2012)
New Revision: 17673

Modified:
   pcbsd/current/src-qt4/qsu/resources/icons/lock.png
   pcbsd/current/src-qt4/qsu/src/conversation.cpp
   pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.cpp
   pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.h
   pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.ui
   pcbsd/current/src-qt4/qsu/src/strings.h
   pcbsd/current/src-qt4/qsu/src/strings_en.c
Log:
Password prompt dialog detailing.



Modified: pcbsd/current/src-qt4/qsu/resources/icons/lock.png
===================================================================
(Binary files differ)

Modified: pcbsd/current/src-qt4/qsu/src/conversation.cpp
===================================================================
--- pcbsd/current/src-qt4/qsu/src/conversation.cpp	2012-07-06 17:57:18 UTC (rev 17672)
+++ pcbsd/current/src-qt4/qsu/src/conversation.cpp	2012-07-06 18:16:50 UTC (rev 17673)
@@ -89,6 +89,8 @@
 	dialog.setWindowTitle(QString(gs_default_title).arg(session->user));
 	if (session->description)
 		dialog.setInformationMessage(session->description);
+	dialog.setUserCaption(gs_default_user_caption);
+	dialog.setUserName(session->user);
 
 	/* process messages */
 	for (int i = 0;

Modified: pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.cpp
===================================================================
--- pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.cpp	2012-07-06 17:57:18 UTC (rev 17672)
+++ pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.cpp	2012-07-06 18:16:50 UTC (rev 17673)
@@ -67,15 +67,26 @@
 }
 
 void
+PasswordPromptDialog::setPasswordEcho(bool echo)
+{
+	m_ui->passwordLineEdit->setEchoMode(echo ? QLineEdit::PasswordEchoOnEdit : QLineEdit::Password);
+}
+
+void
 PasswordPromptDialog::setPasswordPrompt(const QString &prompt)
 {
 	m_ui->promptLabel->setText(prompt);
 	adjustSize();
 }
+void
+PasswordPromptDialog::setUserCaption(const QString &caption)
+{
+	m_ui->userLabel->setText(caption);
+}
 
 void
-PasswordPromptDialog::setPasswordEcho(bool echo)
+PasswordPromptDialog::setUserName(const QString &name)
 {
-	m_ui->passwordLineEdit->setEchoMode(echo ? QLineEdit::PasswordEchoOnEdit : QLineEdit::Password);
+	m_ui->userLineEdit->setText(name);
 }
 

Modified: pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.h
===================================================================
--- pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.h	2012-07-06 17:57:18 UTC (rev 17672)
+++ pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.h	2012-07-06 18:16:50 UTC (rev 17673)
@@ -44,6 +44,8 @@
 	void setInformationMessage(const QString &msg);
 	void setPasswordEcho(bool echo);
 	void setPasswordPrompt(const QString &prompt);
+	void setUserCaption(const QString &caption);
+	void setUserName(const QString &name);
 
 protected:
 	void setupUi(void);

Modified: pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.ui
===================================================================
--- pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.ui	2012-07-06 17:57:18 UTC (rev 17672)
+++ pcbsd/current/src-qt4/qsu/src/passwordpromptdialog.ui	2012-07-06 18:16:50 UTC (rev 17673)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>300</width>
-    <height>145</height>
+    <height>178</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -27,6 +27,12 @@
     <layout class="QHBoxLayout" name="horizontalLayout_2">
      <item>
       <widget class="QLabel" name="iconLabel">
+       <property name="minimumSize">
+        <size>
+         <width>48</width>
+         <height>48</height>
+        </size>
+       </property>
        <property name="maximumSize">
         <size>
          <width>48</width>
@@ -37,7 +43,7 @@
         <pixmap resource="../resources/qsu.qrc">:/icons/lock.png</pixmap>
        </property>
        <property name="alignment">
-        <set>Qt::AlignCenter</set>
+        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
        </property>
       </widget>
      </item>
@@ -53,7 +59,7 @@
         <string/>
        </property>
        <property name="alignment">
-        <set>Qt::AlignCenter</set>
+        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
        </property>
        <property name="wordWrap">
         <bool>true</bool>
@@ -65,21 +71,58 @@
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
-      <widget class="QLabel" name="promptLabel">
-       <property name="text">
-        <string/>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
        </property>
-       <property name="buddy">
-        <cstring>passwordLineEdit</cstring>
+       <property name="sizeType">
+        <enum>QSizePolicy::Preferred</enum>
        </property>
-      </widget>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
      </item>
      <item>
-      <widget class="QLineEdit" name="passwordLineEdit">
-       <property name="echoMode">
-        <enum>QLineEdit::Password</enum>
-       </property>
-      </widget>
+      <layout class="QFormLayout" name="formLayout">
+       <item row="0" column="0">
+        <widget class="QLabel" name="userLabel">
+         <property name="text">
+          <string/>
+         </property>
+         <property name="buddy">
+          <cstring>userLineEdit</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QLineEdit" name="userLineEdit">
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="promptLabel">
+         <property name="text">
+          <string/>
+         </property>
+         <property name="buddy">
+          <cstring>passwordLineEdit</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QLineEdit" name="passwordLineEdit">
+         <property name="echoMode">
+          <enum>QLineEdit::Password</enum>
+         </property>
+        </widget>
+       </item>
+      </layout>
      </item>
     </layout>
    </item>
@@ -151,6 +194,8 @@
  <tabstops>
   <tabstop>passwordLineEdit</tabstop>
   <tabstop>buttonBox</tabstop>
+  <tabstop>userLineEdit</tabstop>
+  <tabstop>passwordLineEdit_2</tabstop>
  </tabstops>
  <resources>
   <include location="../resources/qsu.qrc"/>

Modified: pcbsd/current/src-qt4/qsu/src/strings.h
===================================================================
--- pcbsd/current/src-qt4/qsu/src/strings.h	2012-07-06 17:57:18 UTC (rev 17672)
+++ pcbsd/current/src-qt4/qsu/src/strings.h	2012-07-06 18:16:50 UTC (rev 17673)
@@ -31,6 +31,7 @@
 extern const char *gs_default_desc_other;
 extern const char *gs_default_title;
 extern const char *gs_default_user;
+extern const char *gs_default_user_caption;
 extern const char *gs_error_access_denied;
 extern const char *gs_error_auth_expired;
 extern const char *gs_error_auth_failed;

Modified: pcbsd/current/src-qt4/qsu/src/strings_en.c
===================================================================
--- pcbsd/current/src-qt4/qsu/src/strings_en.c	2012-07-06 17:57:18 UTC (rev 17672)
+++ pcbsd/current/src-qt4/qsu/src/strings_en.c	2012-07-06 18:16:50 UTC (rev 17673)
@@ -36,12 +36,14 @@
     "Authenticating as %1";
 const char *gs_default_user =
     "root";
+const char *gs_default_user_caption =
+    "Name:";
 const char *gs_error_access_denied =
     "Access Denied";
 const char *gs_error_auth_expired =
-    "Expired or invalid authentication token.<br /><b>Access Denied</b>";
+    "Expired or invalid authentication token.";
 const char *gs_error_auth_failed =
-    "Authentication has failed.<br /><b>Access Denied</b>";
+    "User authentication failed.";
 const char *gs_error_database_init =
     "Failed to initialize session database!\n"
     "Please check that the following directory exists and that it's owned by root: %s";



More information about the Commits mailing list