summaryrefslogtreecommitdiff
path: root/padmin
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-12-15 20:37:33 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-12-17 09:35:26 +0000
commit5af4fff6d4dede7e60d407766f30e7191eeeee66 (patch)
treedae7e4bd1d9e63ac833887550ff5d2a4b034b729 /padmin
parentbe61350e8b078fbc34d820868d67f7e393bf93df (diff)
convert print properties tabdialog to .ui format
the dialog itself that is, two of the pages are in .ui format and the rest are pending conversion Change-Id: I5a22cf1603abb0400272ce8969c0b43a00ed7739
Diffstat (limited to 'padmin')
-rw-r--r--padmin/UI_spa.mk1
-rw-r--r--padmin/source/cmddlg.cxx2
-rw-r--r--padmin/source/prtsetup.cxx90
-rw-r--r--padmin/source/prtsetup.hxx8
-rw-r--r--padmin/source/rtsetup.hrc8
-rw-r--r--padmin/source/rtsetup.src45
-rw-r--r--padmin/uiconfig/ui/printerpropertiesdialog.ui149
7 files changed, 200 insertions, 103 deletions
diff --git a/padmin/UI_spa.mk b/padmin/UI_spa.mk
index ce10748729cb..6b1e011a4111 100644
--- a/padmin/UI_spa.mk
+++ b/padmin/UI_spa.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_UI_UI,spa))
$(eval $(call gb_UI_add_uifiles,spa,\
padmin/uiconfig/ui/printerdevicepage \
padmin/uiconfig/ui/printerpaperpage \
+ padmin/uiconfig/ui/printerpropertiesdialog \
))
# vim: set noet sw=4 ts=4:
diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx
index f5496fbfa254..ba0691e3122d 100644
--- a/padmin/source/cmddlg.cxx
+++ b/padmin/source/cmddlg.cxx
@@ -214,7 +214,7 @@ void CommandStore::setFaxCommands( const ::std::list< String >& rCommands )
RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
- TabPage( &pParent->m_aTabControl, PaResId( RID_RTS_COMMANDPAGE ) ),
+ TabPage( pParent->m_pTabControl, PaResId( RID_RTS_COMMANDPAGE ) ),
m_pParent( pParent ),
m_aCommandsCB( this, PaResId( RID_RTS_CMD_CB_COMMANDS ) ),
m_aExternalCB( this, PaResId( RID_RTS_CMD_CB_EXTERNAL ) ),
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 47b800c53d9b..3df1a5ea6fc3 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -79,21 +79,20 @@ void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, con
* RTSDialog
*/
-RTSDialog::RTSDialog( const PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent ) :
- TabDialog( pParent, PaResId( RID_RTS_RTSDIALOG ) ),
- m_aJobData( rJobData ),
- m_aPrinter( rPrinter ),
- m_aTabControl( this, PaResId( RID_RTS_RTSDIALOG_TABCONTROL ) ),
- m_aOKButton( this ),
- m_aCancelButton( this ),
- m_pPaperPage( NULL ),
- m_pDevicePage( NULL ),
- m_pOtherPage( NULL ),
- m_pFontSubstPage( NULL ),
- m_pCommandPage( NULL ),
- m_aInvalidString( PaResId( RID_RTS_RTSDIALOG_INVALID_TXT ) )
-{
- FreeResource();
+RTSDialog::RTSDialog( const PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent )
+ : TabDialog(pParent, "PrinterPropertiesDialog", "spa/ui/printerpropertiesdialog.ui" )
+ , m_aJobData(rJobData)
+ , m_aPrinter(rPrinter)
+ , m_pPaperPage(NULL)
+ , m_pDevicePage(NULL)
+ , m_pOtherPage(NULL)
+ , m_pFontSubstPage(NULL)
+ , m_pCommandPage(NULL)
+ , m_aInvalidString(PaResId(RID_RTS_RTSDIALOG_INVALID_TXT).toString())
+{
+ get(m_pOKButton, "ok");
+ get(m_pCancelButton, "cancel");
+ get(m_pTabControl, "notebook");
String aTitle( GetText() );
aTitle.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), m_aJobData.m_aPrinterName );
@@ -101,23 +100,20 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const String& rPrinter, bool
if( ! bAllPages )
{
- m_aTabControl.RemovePage( RID_RTS_OTHERPAGE );
- m_aTabControl.RemovePage( RID_RTS_FONTSUBSTPAGE );
- m_aTabControl.RemovePage( RID_RTS_COMMANDPAGE );
+ m_pTabControl->RemovePage(m_pTabControl->GetPageId("other"));
+ m_pTabControl->RemovePage(m_pTabControl->GetPageId("font"));
+ m_pTabControl->RemovePage(m_pTabControl->GetPageId("command"));
}
else if( m_aJobData.m_aDriverName.compareToAscii( "CUPS:", 5 ) == 0 && ! PrinterInfoManager::get().isCUPSDisabled() )
{
// command page makes no sense for CUPS printers
- m_aTabControl.RemovePage( RID_RTS_COMMANDPAGE );
+ m_pTabControl->RemovePage(m_pTabControl->GetPageId("command"));
}
- m_aTabControl.SetActivatePageHdl( LINK( this, RTSDialog, ActivatePage ) );
- m_aOKButton.SetClickHdl( LINK( this, RTSDialog, ClickButton ) );
- m_aCancelButton.SetClickHdl( LINK( this, RTSDialog, ClickButton ) );
- ActivatePage( &m_aTabControl );
-
- m_aOKButton.Show();
- m_aCancelButton.Show();
+ m_pTabControl->SetActivatePageHdl( LINK( this, RTSDialog, ActivatePage ) );
+ m_pOKButton->SetClickHdl( LINK( this, RTSDialog, ClickButton ) );
+ m_pCancelButton->SetClickHdl( LINK( this, RTSDialog, ClickButton ) );
+ ActivatePage(m_pTabControl);
}
// --------------------------------------------------------------------------
@@ -140,35 +136,33 @@ RTSDialog::~RTSDialog()
IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl )
{
- if( pTabCtrl != &m_aTabControl )
+ if( pTabCtrl != m_pTabControl )
return 0;
- sal_uInt16 nId = m_aTabControl.GetCurPageId();
-
- if ( ! m_aTabControl.GetTabPage( nId ) )
+ sal_uInt16 nId = m_pTabControl->GetCurPageId();
+ OString sPage = m_pTabControl->GetPageName(nId);
+ if ( ! m_pTabControl->GetTabPage( nId ) )
{
TabPage *pPage = NULL;
- if( nId == RID_RTS_PAPERPAGE )
+ if (sPage == "paper")
pPage = m_pPaperPage = new RTSPaperPage( this );
- else if( nId == RID_RTS_DEVICEPAGE )
+ else if (sPage == "device")
pPage = m_pDevicePage = new RTSDevicePage( this );
- else if( nId == RID_RTS_OTHERPAGE )
+ else if (sPage == "other")
pPage = m_pOtherPage = new RTSOtherPage( this );
- else if( nId == RID_RTS_FONTSUBSTPAGE )
+ else if (sPage == "font")
pPage = m_pFontSubstPage = new RTSFontSubstPage( this );
- else if( nId == RID_RTS_COMMANDPAGE )
+ else if (sPage == "command")
pPage = m_pCommandPage = new RTSCommandPage( this );
if( pPage )
- m_aTabControl.SetTabPage( nId, pPage );
+ m_pTabControl->SetTabPage( nId, pPage );
}
else
{
- switch( nId )
- {
- case RID_RTS_PAPERPAGE: m_pPaperPage->update();break;
- case RID_RTS_DEVICEPAGE: m_pDevicePage->update();break;
- default: break;
- }
+ if (sPage == "paper")
+ m_pPaperPage->update();
+ else if (sPage == "device")
+ m_pDevicePage->update();
}
return 0;
@@ -178,7 +172,7 @@ IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl )
IMPL_LINK( RTSDialog, ClickButton, Button*, pButton )
{
- if( pButton == &m_aOKButton )
+ if( pButton == m_pOKButton )
{
// refresh the changed values
if( m_pPaperPage )
@@ -203,7 +197,7 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton )
EndDialog( 1 );
}
- else if( pButton == &m_aCancelButton )
+ else if( pButton == m_pCancelButton )
EndDialog( 0 );
return 0;
@@ -216,7 +210,7 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton )
*/
RTSPaperPage::RTSPaperPage(RTSDialog* pParent)
- : TabPage(&pParent->m_aTabControl, "PrinterPaperPage", "spa/ui/printerpaperpage.ui" )
+ : TabPage(pParent->m_pTabControl, "PrinterPaperPage", "spa/ui/printerpaperpage.ui" )
, m_pParent( pParent )
{
get(m_pPaperText, "paperft");
@@ -341,7 +335,7 @@ IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox )
*/
RTSDevicePage::RTSDevicePage( RTSDialog* pParent )
- : TabPage(&pParent->m_aTabControl, "PrinterDevicePage", "spa/ui/printerdevicepage.ui" )
+ : TabPage(pParent->m_pTabControl, "PrinterDevicePage", "spa/ui/printerdevicepage.ui" )
, m_pParent( pParent )
{
get(m_pPPDKeyBox, "options");
@@ -530,7 +524,7 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey )
*/
RTSOtherPage::RTSOtherPage( RTSDialog* pParent ) :
- TabPage( &pParent->m_aTabControl, PaResId( RID_RTS_OTHERPAGE ) ),
+ TabPage( pParent->m_pTabControl, PaResId( RID_RTS_OTHERPAGE ) ),
m_pParent( pParent ),
m_aLeftTxt( this, PaResId( RID_RTS_OTHER_LEFTMARGIN_TXT ) ),
m_aLeftLB( this, PaResId( RID_RTS_OTHER_LEFTMARGIN_BOX ) ),
@@ -642,7 +636,7 @@ IMPL_LINK( RTSOtherPage, ClickBtnHdl, Button*, pButton )
*/
RTSFontSubstPage::RTSFontSubstPage( RTSDialog* pParent ) :
- TabPage( &pParent->m_aTabControl, PaResId( RID_RTS_FONTSUBSTPAGE ) ),
+ TabPage( pParent->m_pTabControl, PaResId( RID_RTS_FONTSUBSTPAGE ) ),
m_pParent( pParent ),
m_aSubstitutionsText( this, PaResId( RID_RTS_FS_SUBST_TXT ) ),
m_aSubstitutionsBox( this, PaResId( RID_RTS_FS_SUBST_BOX ) ),
diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx
index 1de4f8956c62..efc217084c2c 100644
--- a/padmin/source/prtsetup.hxx
+++ b/padmin/source/prtsetup.hxx
@@ -55,9 +55,9 @@ class RTSDialog : public TabDialog
String m_aPrinter;
// controls
- TabControl m_aTabControl;
- OKButton m_aOKButton;
- CancelButton m_aCancelButton;
+ TabControl* m_pTabControl;
+ OKButton* m_pOKButton;
+ CancelButton* m_pCancelButton;
// pages
RTSPaperPage* m_pPaperPage;
@@ -67,7 +67,7 @@ class RTSDialog : public TabDialog
RTSCommandPage* m_pCommandPage;
// some resources
- String m_aInvalidString;
+ OUString m_aInvalidString;
DECL_LINK( ActivatePage, TabControl* );
DECL_LINK( ClickButton, Button* );
diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc
index 711e303578de..bf90cf01b5ce 100644
--- a/padmin/source/rtsetup.hrc
+++ b/padmin/source/rtsetup.hrc
@@ -19,10 +19,7 @@
#ifndef _PAD_RTSETUP_HRC_
#define _PAD_RTSETUP_HRC_
-#define RID_RTS_RTSDIALOG 4001
-#define RID_RTS_RTSDIALOG_INVALID_TXT 1
-#define RID_RTS_RTSDIALOG_FROMDRIVER_TXT 2
-#define RID_RTS_RTSDIALOG_TABCONTROL 3
+#define RID_RTS_RTSDIALOG_INVALID_TXT 4001
#define RID_RTS_OTHERPAGE 4002
#define RID_RTS_OTHER_LEFTMARGIN_TXT 1
@@ -37,9 +34,6 @@
#define RID_RTS_OTHER_COMMENT_EDT 10
#define RID_RTS_OTHER_DEFAULT_BTN 11
-#define RID_RTS_DEVICEPAGE 4003
-#define RID_RTS_PAPERPAGE 4004
-
#define RID_RTS_FONTSUBSTPAGE 4005
#define RID_RTS_FS_SUBST_TXT 1
#define RID_RTS_FS_SUBST_BOX 2
diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src
index 56128c7fe302..8edb7a03f75b 100644
--- a/padmin/source/rtsetup.src
+++ b/padmin/source/rtsetup.src
@@ -18,50 +18,9 @@
#include "rtsetup.hrc"
-TabDialog RID_RTS_RTSDIALOG
+String RID_RTS_RTSDIALOG_INVALID_TXT
{
- Moveable = TRUE;
- Sizeable = TRUE;
- Closeable = TRUE;
- SVLook = TRUE;
-
- TabControl RID_RTS_RTSDIALOG_TABCONTROL
- {
- OutputSize = TRUE;
- PageList =
- {
- PageItem
- {
- Identifier = RID_RTS_COMMANDPAGE;
- Text [ en-US ] = "Command";
- };
- PageItem
- {
- Identifier = RID_RTS_PAPERPAGE;
- Text [ en-US ] = "Paper";
- };
- PageItem
- {
- Identifier = RID_RTS_DEVICEPAGE;
- Text [ en-US ] = "Device";
- };
- PageItem
- {
- Identifier = RID_RTS_FONTSUBSTPAGE;
- Text [ en-US ] = "Font Replacement";
- };
- PageItem
- {
- Identifier = RID_RTS_OTHERPAGE;
- Text [ en-US ] = "Other Settings";
- };
- };
- };
- String RID_RTS_RTSDIALOG_INVALID_TXT
- {
- Text [ en-US ] = "<ignore>";
- };
- Text [ en-US ] = "Properties of %s";
+ Text [ en-US ] = "<ignore>";
};
TabPage RID_RTS_FONTSUBSTPAGE
diff --git a/padmin/uiconfig/ui/printerpropertiesdialog.ui b/padmin/uiconfig/ui/printerpropertiesdialog.ui
new file mode 100644
index 000000000000..a84bdb4d7fbf
--- /dev/null
+++ b/padmin/uiconfig/ui/printerpropertiesdialog.ui
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="PrinterPropertiesDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Properties of %s</property>
+ <property name="type_hint">dialog</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">2</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="use_action_appearance">False</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_action_appearance">False</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="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</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="GtkNotebook" id="notebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="command">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Command</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="paper">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Paper</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="device">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Device</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="font">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Font Replacement</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="other">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Other Settings</property>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</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>