Kaydet (Commit) 42aeaee8 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert CUPS password dialog to .ui

Change-Id: Ibdf4da93848e2c8b46f89cbfba4c282291f0c744
üst b3a162cc
......@@ -10,6 +10,7 @@
$(eval $(call gb_UIConfig_UIConfig,spa))
$(eval $(call gb_UIConfig_add_uifiles,spa,\
padmin/uiconfig/ui/cupspassworddialog \
padmin/uiconfig/ui/printerdevicepage \
padmin/uiconfig/ui/printerpaperpage \
padmin/uiconfig/ui/printerpropertiesdialog \
......
......@@ -474,52 +474,39 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey )
class RTSPWDialog : public ModalDialog
{
FixedText m_aText;
FixedText m_aUserText;
Edit m_aUserEdit;
FixedText m_aPassText;
Edit m_aPassEdit;
OKButton m_aOKButton;
CancelButton m_aCancelButton;
FixedText* m_pText;
Edit* m_pUserEdit;
Edit* m_pPassEdit;
public:
RTSPWDialog( const OString& rServer, const OString& rUserName, Window* pParent );
~RTSPWDialog();
RTSPWDialog(const OString& rServer, const OString& rUserName, Window* pParent);
OString getUserName() const;
OString getPassword() const;
};
RTSPWDialog::RTSPWDialog( const OString& rServer, const OString& rUserName, Window* pParent )
:
ModalDialog( pParent, PaResId( RID_RTS_PWDIALOG ) ),
m_aText( this, PaResId( RID_RTS_PWDIALOG_TXT ) ),
m_aUserText( this, PaResId( RID_RTS_PWDIALOG_USER_TXT ) ),
m_aUserEdit( this, PaResId( RID_RTS_PWDIALOG_USER_EDT ) ),
m_aPassText( this, PaResId( RID_RTS_PWDIALOG_PASS_TXT ) ),
m_aPassEdit( this, PaResId( RID_RTS_PWDIALOG_PASS_EDT ) ),
m_aOKButton( this, PaResId( RID_RTS_PWDIALOG_OK_BTN ) ),
m_aCancelButton( this, PaResId( RID_RTS_PWDIALOG_CANCEL_BTN ) )
{
FreeResource();
OUString aText( m_aText.GetText() );
aText = aText.replaceFirst( "%s", OStringToOUString( rServer, osl_getThreadTextEncoding() ) );
m_aText.SetText( aText );
m_aUserEdit.SetText( OStringToOUString( rUserName, osl_getThreadTextEncoding() ) );
}
RTSPWDialog::~RTSPWDialog()
: ModalDialog(pParent, "CUPSPasswordDialog",
"spa/ui/cupspassworddialog.ui")
{
get(m_pText, "text");
get(m_pUserEdit, "user");
get(m_pPassEdit, "pass");
OUString aText(m_pText->GetText());
aText = aText.replaceFirst("%s", OStringToOUString(rServer, osl_getThreadTextEncoding()));
m_pText->SetText(aText);
m_pUserEdit->SetText( OStringToOUString(rUserName, osl_getThreadTextEncoding()));
}
OString RTSPWDialog::getUserName() const
{
return OUStringToOString( m_aUserEdit.GetText(), osl_getThreadTextEncoding() );
return OUStringToOString( m_pUserEdit->GetText(), osl_getThreadTextEncoding() );
}
OString RTSPWDialog::getPassword() const
{
return OUStringToOString( m_aPassEdit.GetText(), osl_getThreadTextEncoding() );
return OUStringToOString( m_pPassEdit->GetText(), osl_getThreadTextEncoding() );
}
extern "C" {
......
......@@ -22,15 +22,6 @@
#define RID_RTS_RTSDIALOG_INVALID_TXT 4001
#define RID_RTS_PWDIALOG 4008
#define RID_RTS_PWDIALOG_TXT 1
#define RID_RTS_PWDIALOG_USER_TXT 2
#define RID_RTS_PWDIALOG_USER_EDT 3
#define RID_RTS_PWDIALOG_PASS_TXT 4
#define RID_RTS_PWDIALOG_PASS_EDT 5
#define RID_RTS_PWDIALOG_OK_BTN 6
#define RID_RTS_PWDIALOG_CANCEL_BTN 7
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -24,61 +24,4 @@ String RID_RTS_RTSDIALOG_INVALID_TXT
Text [ en-US ] = "<ignore>";
};
ModalDialog RID_RTS_PWDIALOG
{
HelpID = "padmin:ModalDialog:RID_RTS_PWDIALOG";
Text [ en-US ] = "Authentication request";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 150 , 90 ) ;
Moveable = TRUE ;
Closeable = TRUE ;
FixedText RID_RTS_PWDIALOG_TXT
{
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 140, 20 );
WordBreak = TRUE;
Text [ en-US ] = "Please enter your authentication data for server %s";
};
FixedText RID_RTS_PWDIALOG_USER_TXT
{
Pos = MAP_APPFONT( 5, 30 );
Size = MAP_APPFONT( 60, 10 );
Text [ en-US ] = "~User";
};
Edit RID_RTS_PWDIALOG_USER_EDT
{
HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_USER_EDT";
Pos = MAP_APPFONT( 70, 29 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
};
FixedText RID_RTS_PWDIALOG_PASS_TXT
{
Pos = MAP_APPFONT( 5, 45 );
Size = MAP_APPFONT( 60, 10 );
Text [ en-US ] = "~Password";
};
Edit RID_RTS_PWDIALOG_PASS_EDT
{
HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_PASS_EDT";
Pos = MAP_APPFONT( 70, 44 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
Password = TRUE;
};
CancelButton RID_RTS_PWDIALOG_CANCEL_BTN
{
Pos = MAP_APPFONT( 95, 70 );
Size = MAP_APPFONT( 50, 15 );
};
OKButton RID_RTS_PWDIALOG_OK_BTN
{
Pos = MAP_APPFONT( 5, 70 );
Size = MAP_APPFONT( 50, 15 );
DefButton = TRUE;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="CUPSPasswordDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Authentication request</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="grid1">
<property name="visible">True</property>
<property name="can_focus">False</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="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_User</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">user</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>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Password</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">pass</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="text">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Please enter your authentication data for server %s</property>
<property name="use_underline">True</property>
<property name="wrap">True</property>
<property name="max_width_chars">56</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="user">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="pass">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="visibility">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment