[Libreoffice-commits] core.git: padmin/source padmin/uiconfig padmin/UIConfig_spa.mk

Caolán McNamara caolanm at redhat.com
Fri Mar 14 06:25:22 PDT 2014


 padmin/UIConfig_spa.mk            |    1 
 padmin/source/helper.cxx          |   41 ++++----------
 padmin/source/helper.hxx          |   12 +---
 padmin/source/padialog.hrc        |    7 --
 padmin/source/padialog.src        |   43 --------------
 padmin/uiconfig/ui/querydialog.ui |  109 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 127 insertions(+), 86 deletions(-)

New commits:
commit 19007d5b1881e30ed5de671a0b84fe0592f8ccf4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 14 13:22:46 2014 +0000

    convert fax (etc) query dialog to .ui
    
    Change-Id: I7de45a208d27ed1b680214808c64e090d9a199f4

diff --git a/padmin/UIConfig_spa.mk b/padmin/UIConfig_spa.mk
index 565f0cc..6ac5ba2 100644
--- a/padmin/UIConfig_spa.mk
+++ b/padmin/UIConfig_spa.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UIConfig_add_uifiles,spa,\
 	padmin/uiconfig/ui/printerdevicepage \
 	padmin/uiconfig/ui/printerpaperpage \
 	padmin/uiconfig/ui/printerpropertiesdialog \
+	padmin/uiconfig/ui/querydialog \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 848da22..fdb974c 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -181,33 +181,18 @@ bool DelListBox::Notify( NotifyEvent& rEvent )
  *  QueryString
  */
 
-QueryString::QueryString( Window* pParent, OUString& rQuery, OUString& rRet, const ::std::list< OUString >& rChoices ) :
-        ModalDialog( pParent, PaResId( RID_STRINGQUERYDLG ) ),
-        m_aOKButton( this, PaResId( RID_STRQRY_BTN_OK ) ),
-        m_aCancelButton( this, PaResId( RID_STRQRY_BTN_CANCEL ) ),
-        m_aFixedText( this, PaResId( RID_STRQRY_TXT_RENAME ) ),
-        m_aEdit( this, PaResId( RID_STRQRY_EDT_NEWNAME ) ),
-        m_aComboBox( this, PaResId( RID_STRQRY_BOX_NEWNAME ) ),
-        m_rReturnValue( rRet )
+QueryString::QueryString(Window* pParent, OUString& rQuery, OUString& rRet)
+    : ModalDialog(pParent, "QueryDialog",
+        "spa/ui/querydialog.ui" )
+    , m_rReturnValue( rRet )
 {
-    FreeResource();
-    m_aOKButton.SetClickHdl( LINK( this, QueryString, ClickBtnHdl ) );
-    m_aFixedText.SetText( rQuery );
-    if( rChoices.begin() != rChoices.end() )
-    {
-        m_aComboBox.SetText( m_rReturnValue );
-        m_aComboBox.InsertEntry( m_rReturnValue );
-        for( ::std::list<OUString>::const_iterator it = rChoices.begin(); it != rChoices.end(); ++it )
-            m_aComboBox.InsertEntry( *it );
-        m_aEdit.Show( false );
-        m_bUseEdit = false;
-    }
-    else
-    {
-        m_aEdit.SetText( m_rReturnValue );
-        m_aComboBox.Show( false );
-        m_bUseEdit = true;
-    }
+    get(m_pOKButton, "ok");
+    get(m_pFixedText, "label");
+    get(m_pEdit, "entry");
+
+    m_pOKButton->SetClickHdl( LINK( this, QueryString, ClickBtnHdl ) );
+    m_pFixedText->SetText( rQuery );
+    m_pEdit->SetText( m_rReturnValue );
     SetText( Application::GetDisplayName() );
 }
 
@@ -217,9 +202,9 @@ QueryString::~QueryString()
 
 IMPL_LINK( QueryString, ClickBtnHdl, Button*, pButton )
 {
-    if( pButton == &m_aOKButton )
+    if (pButton == m_pOKButton)
     {
-        m_rReturnValue = m_bUseEdit ? m_aEdit.GetText() : m_aComboBox.GetText();
+        m_rReturnValue = m_pEdit->GetText();
         EndDialog( 1 );
     }
     else
diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx
index d229766..5a1279a 100644
--- a/padmin/source/helper.hxx
+++ b/padmin/source/helper.hxx
@@ -82,19 +82,15 @@ public:
 class QueryString : public ModalDialog
 {
 private:
-    OKButton     m_aOKButton;
-    CancelButton m_aCancelButton;
-    FixedText    m_aFixedText;
-    Edit         m_aEdit;
-    ComboBox     m_aComboBox;
-
+    OKButton*    m_pOKButton;
+    FixedText*   m_pFixedText;
+    Edit*        m_pEdit;
     OUString&    m_rReturnValue;
-    bool         m_bUseEdit;
 
     DECL_LINK( ClickBtnHdl, Button* );
 
 public:
-    QueryString( Window*, OUString &, OUString &, const ::std::list< OUString >& rChoices = ::std::list<OUString>() );
+    QueryString(Window*, OUString &, OUString &);
     // parent window, Query text, initial value
     ~QueryString();
 };
diff --git a/padmin/source/padialog.hrc b/padmin/source/padialog.hrc
index 206c6d8..f438d05 100644
--- a/padmin/source/padialog.hrc
+++ b/padmin/source/padialog.hrc
@@ -46,13 +46,6 @@
 #define RID_PA_FL_CUPSUSAGE                 23
 #define RID_PA_CB_CUPSUSAGE                 23
 
-#define RID_STRINGQUERYDLG         1003
-#define RID_STRQRY_TXT_RENAME         1
-#define RID_STRQRY_EDT_NEWNAME        2
-#define RID_STRQRY_BTN_OK             3
-#define RID_STRQRY_BTN_CANCEL         4
-#define RID_STRQRY_BOX_NEWNAME         5
-
 #define RID_PPDIMPORT_DLG          1004
 #define RID_PPDIMP_BTN_OK             1
 #define RID_PPDIMP_BTN_CANCEL         2
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index a175e3b..3bfffa7 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -168,49 +168,6 @@ ModalDialog RID_PADIALOG
     Text [ en-US ] = "Printer Administration";
 };
 
-ModalDialog RID_STRINGQUERYDLG
-{
-    HelpID = "padmin:ModalDialog:RID_STRINGQUERYDLG";
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Pos = MAP_APPFONT ( 10 , 10 ) ;
-    Size = MAP_APPFONT ( 200 , 42 ) ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-    FixedText RID_STRQRY_TXT_RENAME
-    {
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 130 , 16 ) ;
-        Wordbreak=TRUE;
-    };
-    Edit RID_STRQRY_EDT_NEWNAME
-    {
-        HelpID = "padmin:Edit:RID_STRINGQUERYDLG:RID_STRQRY_EDT_NEWNAME";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 6 , 23 ) ;
-        Size = MAP_APPFONT ( 130 , 12 ) ;
-    };
-    ComboBox RID_STRQRY_BOX_NEWNAME
-    {
-        HelpID = "padmin:ComboBox:RID_STRINGQUERYDLG:RID_STRQRY_BOX_NEWNAME";
-        Border = TRUE ;
-        DropDown = TRUE;
-        Pos = MAP_APPFONT ( 6 , 23 ) ;
-        Size = MAP_APPFONT ( 130 , 200 ) ;
-    };
-    OKButton RID_STRQRY_BTN_OK
-    {
-        DefButton = TRUE ;
-        Pos = MAP_APPFONT ( 145 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 12 ) ;
-    };
-    CancelButton RID_STRQRY_BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 145 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 12 ) ;
-    };
-};
-
 String RID_ERR_NOPRINTER
 {
     Text [ en-US ] = "Could not open printer %s.";
diff --git a/padmin/uiconfig/ui/querydialog.ui b/padmin/uiconfig/ui/querydialog.ui
new file mode 100644
index 0000000..e51e76cc
--- /dev/null
+++ b/padmin/uiconfig/ui/querydialog.ui
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkDialog" id="QueryDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">New Data Type</property>
+    <property name="type_hint">normal</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="valign">start</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">12</property>
+            <child>
+              <object class="GtkLabel" id="label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">entry</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hexpand">True</property>
+                <property name="invisible_char">•</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list