Kaydet (Commit) 9fe6586a authored tarafından Caolán McNamara's avatar Caolán McNamara

convert print monitory dialog to .ui

Change-Id: I59081c74adaf88d81a3c539c8fbfe3b535d7f6bb
üst 34cebca4
...@@ -149,8 +149,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ ...@@ -149,8 +149,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/paradialog \ sw/uiconfig/swriter/ui/paradialog \
sw/uiconfig/swriter/ui/picturedialog \ sw/uiconfig/swriter/ui/picturedialog \
sw/uiconfig/swriter/ui/previewzoomdialog \ sw/uiconfig/swriter/ui/previewzoomdialog \
sw/uiconfig/swriter/ui/printoptionspage \
sw/uiconfig/swriter/ui/printeroptions \ sw/uiconfig/swriter/ui/printeroptions \
sw/uiconfig/swriter/ui/printmonitordialog \
sw/uiconfig/swriter/ui/printoptionspage \
sw/uiconfig/swriter/ui/privateuserpage \ sw/uiconfig/swriter/ui/privateuserpage \
sw/uiconfig/swriter/ui/renameautotextdialog \ sw/uiconfig/swriter/ui/renameautotextdialog \
sw/uiconfig/swriter/ui/renameobjectdialog \ sw/uiconfig/swriter/ui/renameobjectdialog \
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
// Dialoge -------------------------------------------------------------------- // Dialoge --------------------------------------------------------------------
#define DLG_PRINTMONITOR (RC_DBUI_BEGIN + 1)
#define DLG_AP_INSERT_DB_SEL (RC_DBUI_BEGIN + 2) #define DLG_AP_INSERT_DB_SEL (RC_DBUI_BEGIN + 2)
#define DLG_MAILMERGEWIZARD (RC_DBUI_BEGIN + 3) #define DLG_MAILMERGEWIZARD (RC_DBUI_BEGIN + 3)
...@@ -57,7 +56,6 @@ ...@@ -57,7 +56,6 @@
#define DLG_MM_CREATIONMONITOR (RC_DBUI_BEGIN + 30) #define DLG_MM_CREATIONMONITOR (RC_DBUI_BEGIN + 30)
// Strings ------------------------------------------------------------------ // Strings ------------------------------------------------------------------
#define STR_DB_EMAIL (RC_DBUI_BEGIN)
#define SA_ADDRESS_HEADER (RC_DBUI_BEGIN + 1) #define SA_ADDRESS_HEADER (RC_DBUI_BEGIN + 1)
#define STR_NOTASSIGNED (RC_DBUI_BEGIN + 2) #define STR_NOTASSIGNED (RC_DBUI_BEGIN + 2)
#define STR_FILTER_ALL (RC_DBUI_BEGIN + 3) #define STR_FILTER_ALL (RC_DBUI_BEGIN + 3)
...@@ -71,27 +69,17 @@ ...@@ -71,27 +69,17 @@
#define STR_FILTER_MDB (RC_DBUI_BEGIN + 11) #define STR_FILTER_MDB (RC_DBUI_BEGIN + 11)
#define STR_FILTER_ACCDB (RC_DBUI_BEGIN + 12) #define STR_FILTER_ACCDB (RC_DBUI_BEGIN + 12)
// Bitmaps ------------------------------------------------------------------
// Elements ----------------------------------------------------------------- // Elements -----------------------------------------------------------------
#define TLB_DBLIST 1
#define BTN_OK 2 #define BTN_OK 2
#define BTN_CANCEL 3 #define BTN_CANCEL 3
#define BTN_HELP 4 #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 PB_CANCELPRNMON 9
#define FT_STATUS 12 #define FT_STATUS 12
#define FT_CREATEDOCUMENTS 13 #define FT_CREATEDOCUMENTS 13
#define FT_PROGRESS 14 #define FT_PROGRESS 14
#define FT_COUNTING 15 #define FT_COUNTING 15
#define STR_SAVEMON 16
#define FT_SAVING 17
#define MM_PART_TITLE 0 #define MM_PART_TITLE 0
#define MM_PART_FIRSTNAME 1 #define MM_PART_FIRSTNAME 1
......
...@@ -949,9 +949,9 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -949,9 +949,9 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
} }
PrintMonitor aPrtMonDlg(&pSourceShell->GetView().GetEditWin(), PrintMonitor::MONITOR_TYPE_PRINT); 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()) if (!IsMergeSilent())
aPrtMonDlg.Show(); aPrtMonDlg.Show();
...@@ -1016,11 +1016,11 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -1016,11 +1016,11 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
else else
{ {
INetURLObject aTempFileURL(aTempFile->GetURL()); INetURLObject aTempFileURL(aTempFile->GetURL());
aPrtMonDlg.aPrinter.SetText( aTempFileURL.GetBase() ); aPrtMonDlg.m_pPrinter->SetText( aTempFileURL.GetBase() );
String sStat(SW_RES(STR_STATSTR_LETTER)); // Brief String sStat(SW_RES(STR_STATSTR_LETTER)); // Brief
sStat += ' '; sStat += ' ';
sStat += OUString::number( nDocNo ); sStat += OUString::number( nDocNo );
aPrtMonDlg.aPrintInfo.SetText(sStat); aPrtMonDlg.m_pPrintInfo->SetText(sStat);
// computation time for Save-Monitor: // computation time for Save-Monitor:
for (sal_uInt16 i = 0; i < 25; i++) for (sal_uInt16 i = 0; i < 25; i++)
......
...@@ -23,61 +23,25 @@ ...@@ -23,61 +23,25 @@
#include "dbui.hrc" #include "dbui.hrc"
#include "dbui.hxx" #include "dbui.hxx"
PrintMonitor::PrintMonitor( Window *pParent, PrintMonitorType eType ) PrintMonitor::PrintMonitor(Window *pParent, PrintMonitorType eType )
: ModelessDialog( pParent, SW_RES(DLG_PRINTMONITOR) ), : ModelessDialog(pParent, "PrintMonitorDialog",
aDocName (this, SW_RES( FT_DOCNAME )), "modules/swriter/ui/printmonitordialog.ui")
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 ))
{ {
get(m_pCancel, "cancel");
get(m_pDocName, "docname");
get(m_pPrinter, "printer");
get(m_pPrintInfo, "printinfo");
switch (eType) switch (eType)
{ {
case MONITOR_TYPE_SAVE: SetText(SW_RES(STR_SAVEMON)); break; case MONITOR_TYPE_SAVE:
case MONITOR_TYPE_PRINT: break; SetText(get<FixedText>("alttitle")->GetText());
} get(m_pPrinting, "saving");
FreeResource(); break;
} case MONITOR_TYPE_PRINT:
get(m_pPrinting, "printing");
static void lcl_ResizeControl( Window* pWin, long nDiff ) break;
{
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 );
} }
m_pPrinting->Show();
} }
// Progress Indicator for Creation of personalized Mail Merge documents: // Progress Indicator for Creation of personalized Mail Merge documents:
......
...@@ -20,65 +20,6 @@ ...@@ -20,65 +20,6 @@
#include "dbui.hrc" #include "dbui.hrc"
#include "helpid.h" #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 StringArray SA_ADDRESS_HEADER
{ {
ItemList [en-US]= ItemList [en-US]=
......
...@@ -745,11 +745,9 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) ...@@ -745,11 +745,9 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
SwView* pSourceView = rConfigItem.GetSourceView(); SwView* pSourceView = rConfigItem.GetSourceView();
PrintMonitor aSaveMonitor(this, PrintMonitor::MONITOR_TYPE_SAVE); PrintMonitor aSaveMonitor(this, PrintMonitor::MONITOR_TYPE_SAVE);
aSaveMonitor.aDocName.SetText(pSourceView->GetDocShell()->GetTitle(22)); aSaveMonitor.m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22));
aSaveMonitor.aCancel.SetClickHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl)); aSaveMonitor.m_pCancel->SetClickHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
aSaveMonitor.aPrinter.SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) ); aSaveMonitor.m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
aSaveMonitor.ResizeControls();
m_bCancelSaving = false; m_bCancelSaving = false;
aSaveMonitor.Show(); aSaveMonitor.Show();
m_pWizard->enableButtons(WZB_CANCEL, sal_False); m_pWizard->enableButtons(WZB_CANCEL, sal_False);
...@@ -768,7 +766,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) ...@@ -768,7 +766,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
String sStat(SW_RES(STR_STATSTR_LETTER)); String sStat(SW_RES(STR_STATSTR_LETTER));
sStat += ' '; sStat += ' ';
sStat += OUString::number( nDoc ); sStat += OUString::number( nDoc );
aSaveMonitor.aPrintInfo.SetText(sStat); aSaveMonitor.m_pPrintInfo->SetText(sStat);
//now extract a document from the target document //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 // the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here
......
...@@ -33,15 +33,13 @@ public: ...@@ -33,15 +33,13 @@ public:
MONITOR_TYPE_PRINT, MONITOR_TYPE_PRINT,
MONITOR_TYPE_SAVE MONITOR_TYPE_SAVE
}; };
FixedText aDocName; FixedText* m_pDocName;
FixedText aPrinting; FixedText* m_pPrinting;
FixedText aPrinter; FixedText* m_pPrinter;
FixedText aPrintInfo; FixedText* m_pPrintInfo;
CancelButton aCancel; CancelButton* m_pCancel;
PrintMonitor( Window *pParent, PrintMonitorType eType ); PrintMonitor( Window *pParent, PrintMonitorType eType );
void ResizeControls();
}; };
class CreateMonitor : public ModelessDialog class CreateMonitor : public ModelessDialog
......
<?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>
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