summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-22 12:50:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-22 14:35:10 +0100
commit9fe6586a0bb3f10e3bca6f1215733d373e8fdac3 (patch)
treeea5d5cefc454e94526511b14cc5dfeb6f7b3db8f /sw
parent34cebca4850a9b93846e51c7321a4e66b5e73959 (diff)
convert print monitory dialog to .ui
Change-Id: I59081c74adaf88d81a3c539c8fbfe3b535d7f6bb
Diffstat (limited to 'sw')
-rw-r--r--sw/UIConfig_swriter.mk3
-rw-r--r--sw/inc/dbui.hrc12
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx8
-rw-r--r--sw/source/ui/dbui/dbui.cxx66
-rw-r--r--sw/source/ui/dbui/dbui.src59
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx10
-rw-r--r--sw/source/ui/inc/dbui.hxx12
-rw-r--r--sw/uiconfig/swriter/ui/printmonitordialog.ui128
8 files changed, 158 insertions, 140 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index f9d1578279ac..f3eb50f21c6c 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -149,8 +149,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/paradialog \
sw/uiconfig/swriter/ui/picturedialog \
sw/uiconfig/swriter/ui/previewzoomdialog \
- sw/uiconfig/swriter/ui/printoptionspage \
sw/uiconfig/swriter/ui/printeroptions \
+ sw/uiconfig/swriter/ui/printmonitordialog \
+ sw/uiconfig/swriter/ui/printoptionspage \
sw/uiconfig/swriter/ui/privateuserpage \
sw/uiconfig/swriter/ui/renameautotextdialog \
sw/uiconfig/swriter/ui/renameobjectdialog \
diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc
index e5dabf07f31d..760835eb02ca 100644
--- a/sw/inc/dbui.hrc
+++ b/sw/inc/dbui.hrc
@@ -24,7 +24,6 @@
// Dialoge --------------------------------------------------------------------
-#define DLG_PRINTMONITOR (RC_DBUI_BEGIN + 1)
#define DLG_AP_INSERT_DB_SEL (RC_DBUI_BEGIN + 2)
#define DLG_MAILMERGEWIZARD (RC_DBUI_BEGIN + 3)
@@ -57,7 +56,6 @@
#define DLG_MM_CREATIONMONITOR (RC_DBUI_BEGIN + 30)
// Strings ------------------------------------------------------------------
-#define STR_DB_EMAIL (RC_DBUI_BEGIN)
#define SA_ADDRESS_HEADER (RC_DBUI_BEGIN + 1)
#define STR_NOTASSIGNED (RC_DBUI_BEGIN + 2)
#define STR_FILTER_ALL (RC_DBUI_BEGIN + 3)
@@ -71,27 +69,17 @@
#define STR_FILTER_MDB (RC_DBUI_BEGIN + 11)
#define STR_FILTER_ACCDB (RC_DBUI_BEGIN + 12)
-// Bitmaps ------------------------------------------------------------------
-
-
// Elements -----------------------------------------------------------------
-#define TLB_DBLIST 1
#define BTN_OK 2
#define BTN_CANCEL 3
#define BTN_HELP 4
-#define FT_DOCNAME 5
-#define FT_PRINTING 6
-#define FT_PRINTER 7
-#define FT_PRINTINFO 8
#define PB_CANCELPRNMON 9
#define FT_STATUS 12
#define FT_CREATEDOCUMENTS 13
#define FT_PROGRESS 14
#define FT_COUNTING 15
-#define STR_SAVEMON 16
-#define FT_SAVING 17
#define MM_PART_TITLE 0
#define MM_PART_FIRSTNAME 1
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index f61471a0f2ff..5f97d75eedcb 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -949,9 +949,9 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
}
PrintMonitor aPrtMonDlg(&pSourceShell->GetView().GetEditWin(), PrintMonitor::MONITOR_TYPE_PRINT);
- aPrtMonDlg.aDocName.SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22));
+ aPrtMonDlg.m_pDocName->SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22));
- aPrtMonDlg.aCancel.SetClickHdl(LINK(this, SwNewDBMgr, PrtCancelHdl));
+ aPrtMonDlg.m_pCancel->SetClickHdl(LINK(this, SwNewDBMgr, PrtCancelHdl));
if (!IsMergeSilent())
aPrtMonDlg.Show();
@@ -1016,11 +1016,11 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
else
{
INetURLObject aTempFileURL(aTempFile->GetURL());
- aPrtMonDlg.aPrinter.SetText( aTempFileURL.GetBase() );
+ aPrtMonDlg.m_pPrinter->SetText( aTempFileURL.GetBase() );
String sStat(SW_RES(STR_STATSTR_LETTER)); // Brief
sStat += ' ';
sStat += OUString::number( nDocNo );
- aPrtMonDlg.aPrintInfo.SetText(sStat);
+ aPrtMonDlg.m_pPrintInfo->SetText(sStat);
// computation time for Save-Monitor:
for (sal_uInt16 i = 0; i < 25; i++)
diff --git a/sw/source/ui/dbui/dbui.cxx b/sw/source/ui/dbui/dbui.cxx
index aad23f22e222..09b235731120 100644
--- a/sw/source/ui/dbui/dbui.cxx
+++ b/sw/source/ui/dbui/dbui.cxx
@@ -23,61 +23,25 @@
#include "dbui.hrc"
#include "dbui.hxx"
-PrintMonitor::PrintMonitor( Window *pParent, PrintMonitorType eType )
-: ModelessDialog( pParent, SW_RES(DLG_PRINTMONITOR) ),
- aDocName (this, SW_RES( FT_DOCNAME )),
- aPrinting (this, SW_RES(
- eType == MONITOR_TYPE_SAVE ? FT_SAVING : FT_PRINTING )),
- aPrinter (this, SW_RES( FT_PRINTER )),
- aPrintInfo (this, SW_RES( FT_PRINTINFO )),
- aCancel (this, SW_RES( PB_CANCELPRNMON ))
+PrintMonitor::PrintMonitor(Window *pParent, PrintMonitorType eType )
+ : ModelessDialog(pParent, "PrintMonitorDialog",
+ "modules/swriter/ui/printmonitordialog.ui")
{
+ get(m_pCancel, "cancel");
+ get(m_pDocName, "docname");
+ get(m_pPrinter, "printer");
+ get(m_pPrintInfo, "printinfo");
switch (eType)
{
- case MONITOR_TYPE_SAVE: SetText(SW_RES(STR_SAVEMON)); break;
- case MONITOR_TYPE_PRINT: break;
- }
- FreeResource();
-}
-
-static void lcl_ResizeControl( Window* pWin, long nDiff )
-{
- Size aSize( pWin->GetSizePixel() );
- aSize.Width() += nDiff;
- pWin->SetSizePixel( aSize );
-}
-static void lcl_RePosControl( Window* pWin, long nDiff )
-{
- Point aPos( pWin->GetPosPixel() );
- aPos.X() += nDiff;
- pWin->SetPosPixel( aPos );
-}
-
-void PrintMonitor::ResizeControls()
-{
- Size aDlgSize( GetSizePixel() );
- Size aPrinterSize( aPrinter.GetSizePixel() );
- long nPrinterTextWidth = aPrinter.GetTextWidth( aPrinter.GetText() );
- if( nPrinterTextWidth > aPrinterSize.Width() )
- {
- //increase control and dialog width if printer text is too long
- //do not increase dialog width more than three times
- long nDiff = nPrinterTextWidth - aPrinterSize.Width();
- if( nDiff > 2 * aDlgSize.Width() )
- {
- aPrinter.SetStyle( WB_RIGHT | aPrinter.GetStyle() );
- nDiff = 2 * aDlgSize.Width();
- }
- aDlgSize.Width() += nDiff;
- SetSizePixel(aDlgSize);
- lcl_ResizeControl( &aPrinter, nDiff );
-
- nDiff /= 2;
- lcl_RePosControl( &aDocName, nDiff );
- lcl_RePosControl( &aPrinting, nDiff );
- lcl_RePosControl( &aPrintInfo, nDiff );
- lcl_RePosControl( &aCancel, nDiff );
+ case MONITOR_TYPE_SAVE:
+ SetText(get<FixedText>("alttitle")->GetText());
+ get(m_pPrinting, "saving");
+ break;
+ case MONITOR_TYPE_PRINT:
+ get(m_pPrinting, "printing");
+ break;
}
+ m_pPrinting->Show();
}
// Progress Indicator for Creation of personalized Mail Merge documents:
diff --git a/sw/source/ui/dbui/dbui.src b/sw/source/ui/dbui/dbui.src
index 79aff5dee110..51ee91a00ac3 100644
--- a/sw/source/ui/dbui/dbui.src
+++ b/sw/source/ui/dbui/dbui.src
@@ -20,65 +20,6 @@
#include "dbui.hrc"
#include "helpid.h"
- // DLG_PRINTMONITOR ------------------------------------------------------
-ModelessDialog DLG_PRINTMONITOR
-{
- SVLOOK = TRUE ;
- HIDE = TRUE ;
- OUTPUTSIZE = TRUE ;
- Size = MAP_APPFONT ( 118, 72 ) ;
- MOVEABLE = TRUE ;
- APP = FALSE ;
- FixedText FT_DOCNAME
- {
- Pos = MAP_APPFONT ( 6,6 ) ;
- Size = MAP_APPFONT ( 100, 8 ) ;
- CENTER = TRUE ;
- };
- FixedText FT_PRINTING
- {
- Pos = MAP_APPFONT ( 6, 17 ) ;
- Size = MAP_APPFONT ( 100, 8 ) ;
- CENTER = TRUE ;
- Text [ en-US ] = "is being prepared for printing on" ;
- };
- FixedText FT_SAVING
- {
- Pos = MAP_APPFONT ( 6, 17 ) ;
- Size = MAP_APPFONT ( 100, 8 ) ;
- CENTER = TRUE ;
- Text [ en-US ] = "is being saved to" ;
- };
- FixedText FT_PRINTER
- {
- Pos = MAP_APPFONT ( 6, 28 ) ;
- Size = MAP_APPFONT ( 100, 8 ) ;
- CENTER = TRUE ;
- };
- FixedText FT_PRINTINFO
- {
- Pos = MAP_APPFONT ( 6, 39 ) ;
- Size = MAP_APPFONT ( 100, 8 ) ;
- CENTER = TRUE ;
- };
- CancelButton PB_CANCELPRNMON
- {
- Pos = MAP_APPFONT ( 31, 52 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TABSTOP = TRUE ;
- };
- String STR_SAVEMON
- {
- Text [ en-US ] = "Save-Monitor";
- };
- Text [ en-US ] = "Print monitor" ;
-};
-
-String STR_DB_EMAIL
-{
- Text [ en-US ] = "E-mail" ;
-};
-
StringArray SA_ADDRESS_HEADER
{
ItemList [en-US]=
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 2a7f742a7904..123942372153 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -745,11 +745,9 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
SwView* pSourceView = rConfigItem.GetSourceView();
PrintMonitor aSaveMonitor(this, PrintMonitor::MONITOR_TYPE_SAVE);
- aSaveMonitor.aDocName.SetText(pSourceView->GetDocShell()->GetTitle(22));
- aSaveMonitor.aCancel.SetClickHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
- aSaveMonitor.aPrinter.SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
- aSaveMonitor.ResizeControls();
-
+ aSaveMonitor.m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22));
+ aSaveMonitor.m_pCancel->SetClickHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
+ aSaveMonitor.m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
m_bCancelSaving = false;
aSaveMonitor.Show();
m_pWizard->enableButtons(WZB_CANCEL, sal_False);
@@ -768,7 +766,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
String sStat(SW_RES(STR_STATSTR_LETTER));
sStat += ' ';
sStat += OUString::number( nDoc );
- aSaveMonitor.aPrintInfo.SetText(sStat);
+ aSaveMonitor.m_pPrintInfo->SetText(sStat);
//now extract a document from the target document
// the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here
diff --git a/sw/source/ui/inc/dbui.hxx b/sw/source/ui/inc/dbui.hxx
index 30190ab2f980..b0558cdbb2d3 100644
--- a/sw/source/ui/inc/dbui.hxx
+++ b/sw/source/ui/inc/dbui.hxx
@@ -33,15 +33,13 @@ public:
MONITOR_TYPE_PRINT,
MONITOR_TYPE_SAVE
};
- FixedText aDocName;
- FixedText aPrinting;
- FixedText aPrinter;
- FixedText aPrintInfo;
- CancelButton aCancel;
+ FixedText* m_pDocName;
+ FixedText* m_pPrinting;
+ FixedText* m_pPrinter;
+ FixedText* m_pPrintInfo;
+ CancelButton* m_pCancel;
PrintMonitor( Window *pParent, PrintMonitorType eType );
-
- void ResizeControls();
};
class CreateMonitor : public ModelessDialog
diff --git a/sw/uiconfig/swriter/ui/printmonitordialog.ui b/sw/uiconfig/swriter/ui/printmonitordialog.ui
new file mode 100644
index 000000000000..26407d808928
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/printmonitordialog.ui
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="PrintMonitorDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Print monitor</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">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="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">0</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="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="alttitle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Save-Monitor</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="docname">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="printing">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">is being prepared for printing on</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="saing">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">is being saved to</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="printer">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="printinfo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</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">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>