@ -25,7 +25,7 @@
//QT includes
# include <tqdir.h>
# include < layout.h>
# include < tq layout.h>
# include <tqlabel.h>
# include <tqcombobox.h>
# include <tqwidgetstack.h>
@ -75,44 +75,44 @@ namespace BookshelfManager {
TQFrame * page = m_swordConfigPage = addPage ( i18n ( " Bookshelf path(s) " ) , TQString ( ) , SmallIcon ( " bt_swordconfig " , 32 ) ) ;
page - > setMinimumSize ( 500 , 400 ) ;
TQGridLayout * layout = new TQGridLayout ( page , 6 , 4 ) ;
layout- > setMargin ( 5 ) ;
TQGridLayout * tq layout = new TQGridLayout ( page , 6 , 4 ) ;
tq layout- > setMargin ( 5 ) ;
layout- > setSpacing ( 10 ) ;
layout- > setColStretch ( 0 , 1 ) ;
layout- > setRowStretch ( 5 , 1 ) ;
tq layout- > setSpacing ( 10 ) ;
tq layout- > setColStretch ( 0 , 1 ) ;
tq layout- > setRowStretch ( 5 , 1 ) ;
TQLabel * mainLabel = CToolClass : : explanationLabel ( page ,
i18n ( " Configure bookshelf path(s) " ) ,
i18n ( " You can store your bookshelfs in one or more directories, which you can specify here. " )
) ;
layout- > addMultiCellWidget ( mainLabel , 0 , 0 , 0 , 3 ) ;
tq layout- > addMultiCellWidget ( mainLabel , 0 , 0 , 0 , 3 ) ;
TQString swordConfPath = BTInstallMgr : : Tool : : LocalConfig : : swordConfigFilename ( ) ;
TQLabel * confPathLabel = new TQLabel ( i18n ( " Your bookshelf configuration file is <b>%1</b> " ) . arg( swordConfPath ) , page ) ;
layout- > addMultiCellWidget ( confPathLabel , 1 , 1 , 0 , 3 ) ;
TQLabel * confPathLabel = new TQLabel ( i18n ( " Your bookshelf configuration file is <b>%1</b> " ) . tq arg( swordConfPath ) , page ) ;
tq layout- > addMultiCellWidget ( confPathLabel , 1 , 1 , 0 , 3 ) ;
m_swordPathListBox = new TQListView ( page ) ;
// m_swordPathListBox->setFullWidth(true);
m_swordPathListBox - > addColumn ( i18n ( " Path to bookshelf " ) ) ;
connect ( m_swordPathListBox , TQT_SIGNAL ( selectionChanged ( ) ) , this , TQT_SLOT ( slot_swordPathSelected ( ) ) ) ;
layout- > addMultiCellWidget ( m_swordPathListBox , 2 , 5 , 0 , 1 ) ;
tq layout- > addMultiCellWidget ( m_swordPathListBox , 2 , 5 , 0 , 1 ) ;
m_swordEditPathButton = new TQPushButton ( i18n ( " Edit Entry " ) , page ) ;
m_swordEditPathButton - > setIconSet ( SmallIcon ( " edit " , 16 ) ) ;
connect ( m_swordEditPathButton , TQT_SIGNAL ( clicked ( ) ) , this , TQT_SLOT ( slot_swordEditClicked ( ) ) ) ;
layout- > addWidget ( m_swordEditPathButton , 2 , 3 ) ;
tq layout- > addWidget ( m_swordEditPathButton , 2 , 3 ) ;
m_swordAddPathButton = new TQPushButton ( i18n ( " Add Entry " ) , page ) ;
m_swordAddPathButton - > setIconSet ( SmallIcon ( " edit_add " , 16 ) ) ;
connect ( m_swordAddPathButton , TQT_SIGNAL ( clicked ( ) ) , this , TQT_SLOT ( slot_swordAddClicked ( ) ) ) ;
layout- > addWidget ( m_swordAddPathButton , 3 , 3 ) ;
tq layout- > addWidget ( m_swordAddPathButton , 3 , 3 ) ;
m_swordRemovePathButton = new TQPushButton ( i18n ( " Remove Entry " ) , page ) ;
m_swordRemovePathButton - > setIconSet ( SmallIcon ( " editdelete " , 16 ) ) ;
connect ( m_swordRemovePathButton , TQT_SIGNAL ( clicked ( ) ) , this , TQT_SLOT ( slot_swordRemoveClicked ( ) ) ) ;
layout- > addWidget ( m_swordRemovePathButton , 4 , 3 ) ;
tq layout- > addWidget ( m_swordRemovePathButton , 4 , 3 ) ;
setupSwordPathListBox ( ) ;
}
@ -120,25 +120,25 @@ namespace BookshelfManager {
void CSwordSetupDialog : : initInstall ( ) {
m_installPage = addPage ( i18n ( " Install/Update works " ) , TQString ( ) , SmallIcon ( " bt_bible " , 32 ) ) ;
TQVBoxLayout * vbox layout = new TQVBoxLayout ( m_installPage ) ;
TQHBoxLayout * hbox layout = new TQHBoxLayout ( ) ;
hbox layout- > setAutoAdd ( true ) ;
TQVBoxLayout * vbox tq layout = new TQVBoxLayout ( m_installPage ) ;
TQHBoxLayout * hbox tq layout = new TQHBoxLayout ( ) ;
hbox tq layout- > setAutoAdd ( true ) ;
vbox layout- > addLayout ( hbox layout) ;
vbox tq layout- > addLayout ( hbox tq layout) ;
m_installWidgetStack = new TQWidgetStack ( m_installPage ) ;
hbox layout- > addWidget ( m_installWidgetStack ) ;
hbox tq layout- > addWidget ( m_installWidgetStack ) ;
m_installSourcePage = new TQWidget ( 0 ) ;
m_installWidgetStack - > addWidget ( m_installSourcePage ) ;
// m_installSourcePage->setMinimumSize(500,400);
TQGridLayout * layout = new TQGridLayout ( m_installSourcePage , 7 , 3 ) ;
layout- > setMargin ( 5 ) ;
layout- > setSpacing ( 10 ) ;
layout- > setRowStretch ( 6 , 5 ) ;
layout- > setColStretch ( 0 , 5 ) ;
TQGridLayout * tq layout = new TQGridLayout ( m_installSourcePage , 7 , 3 ) ;
tq layout- > setMargin ( 5 ) ;
tq layout- > setSpacing ( 10 ) ;
tq layout- > setRowStretch ( 6 , 5 ) ;
tq layout- > setColStretch ( 0 , 5 ) ;
TQLabel * installLabel = CToolClass : : explanationLabel ( m_installSourcePage ,
i18n ( " Install/update works - Step 1 " ) ,
@ -147,39 +147,39 @@ After that step click on the connect button.<br/>\
< b > WARNING : If you live in a persecuted country and do not wish to risk detection you should NOT use \
the module remote installation feature ! < / b > " )
) ;
layout- > addMultiCellWidget ( installLabel , 0 , 0 , 0 , 2 ) ;
tq layout- > addMultiCellWidget ( installLabel , 0 , 0 , 0 , 2 ) ;
TQLabel * sourceHeadingLabel = new TQLabel ( TQString ( " <b>%1</b> " ) . arg( i18n ( " Select library " ) ) , m_installSourcePage ) ;
layout- > addMultiCellWidget ( sourceHeadingLabel , 1 , 1 , 0 , 1 ) ;
TQLabel * sourceHeadingLabel = new TQLabel ( TQString ( " <b>%1</b> " ) . tq arg( i18n ( " Select library " ) ) , m_installSourcePage ) ;
tq layout- > addMultiCellWidget ( sourceHeadingLabel , 1 , 1 , 0 , 1 ) ;
m_sourceCombo = new TQComboBox ( m_installSourcePage ) ;
layout- > addWidget ( m_sourceCombo , 2 , 0 ) ;
tq layout- > addWidget ( m_sourceCombo , 2 , 0 ) ;
TQPushButton * deleteSourceButton = new TQPushButton ( i18n ( " Delete library " ) , m_installSourcePage ) ;
deleteSourceButton - > setIconSet ( SmallIcon ( " remove " , 16 ) ) ;
connect ( deleteSourceButton , TQT_SIGNAL ( clicked ( ) ) , TQT_SLOT ( slot_installDeleteSource ( ) ) ) ;
layout- > addWidget ( deleteSourceButton , 2 , 1 , TQt : : AlignLeft ) ;
tq layout- > addWidget ( deleteSourceButton , 2 , 1 , TQt : : AlignLeft ) ;
TQPushButton * addSourceButton = new TQPushButton ( i18n ( " Add library " ) , m_installSourcePage ) ;
addSourceButton - > setIconSet ( SmallIcon ( " folder_new " , 16 ) ) ;
connect ( addSourceButton , TQT_SIGNAL ( clicked ( ) ) , TQT_SLOT ( slot_installAddSource ( ) ) ) ;
layout- > addWidget ( addSourceButton , 2 , 2 , TQt : : AlignLeft ) ;
tq layout- > addWidget ( addSourceButton , 2 , 2 , TQt : : AlignLeft ) ;
m_sourceLabel = new TQLabel ( m_installSourcePage ) ;
layout- > addMultiCellWidget ( m_sourceLabel , 3 , 3 , 0 , 1 ) ;
tq layout- > addMultiCellWidget ( m_sourceLabel , 3 , 3 , 0 , 1 ) ;
TQLabel * targetHeadingLabel = new TQLabel ( TQString ( " <b>%1</b> " ) . arg( i18n ( " Select bookshelf path " ) ) , m_installSourcePage ) ;
layout- > addMultiCellWidget ( targetHeadingLabel , 4 , 4 , 0 , 1 ) ;
TQLabel * targetHeadingLabel = new TQLabel ( TQString ( " <b>%1</b> " ) . tq arg( i18n ( " Select bookshelf path " ) ) , m_installSourcePage ) ;
tq layout- > addMultiCellWidget ( targetHeadingLabel , 4 , 4 , 0 , 1 ) ;
m_targetCombo = new TQComboBox ( m_installSourcePage ) ;
layout- > addWidget ( m_targetCombo , 5 , 0 ) ;
tq layout- > addWidget ( m_targetCombo , 5 , 0 ) ;
m_targetLabel = new TQLabel ( m_installSourcePage ) ;
layout- > addMultiCellWidget ( m_targetLabel , 6 , 6 , 0 , 0 , TQt : : AlignTop ) ;
tq layout- > addMultiCellWidget ( m_targetLabel , 6 , 6 , 0 , 0 , TQt : : AlignTop ) ;
//part beloew main layout with the back/next buttons
//part beloew main tq layout with the back/next buttons
TQHBoxLayout * myHBox = new TQHBoxLayout ( ) ;
vbox layout- > addLayout ( myHBox ) ;
vbox tq layout- > addLayout ( myHBox ) ;
m_installBackButton = new TQPushButton ( i18n ( " Back " ) , m_installPage ) ;
m_installBackButton - > setIconSet ( SmallIcon ( " back " , 16 ) ) ;
@ -207,28 +207,28 @@ the module remote installation feature!</b>")
page - > setMinimumSize ( 500 , 400 ) ;
TQGridLayout * layout = new TQGridLayout ( page , 4 , 4 ) ;
layout- > setMargin ( 5 ) ;
TQGridLayout * tq layout = new TQGridLayout ( page , 4 , 4 ) ;
tq layout- > setMargin ( 5 ) ;
layout- > setSpacing ( 10 ) ;
layout- > setColStretch ( 1 , 1 ) ;
layout- > setRowStretch ( 2 , 1 ) ;
tq layout- > setSpacing ( 10 ) ;
tq layout- > setColStretch ( 1 , 1 ) ;
tq layout- > setRowStretch ( 2 , 1 ) ;
TQLabel * mainLabel = CToolClass : : explanationLabel ( page ,
i18n ( " Remove installed work(s) " ) ,
i18n ( " This dialog lets you remove installed works from your system. Choose the modules and then click on the remove button. " )
) ;
layout- > addMultiCellWidget ( mainLabel , 0 , 0 , 0 , 3 ) ;
tq layout- > addMultiCellWidget ( mainLabel , 0 , 0 , 0 , 3 ) ;
TQLabel * headingLabel = new TQLabel ( TQString ( " <b>%1</b> " ) . arg( i18n ( " Select works to be uninstalled " ) ) , page ) ;
layout- > addMultiCellWidget ( headingLabel , 1 , 1 , 0 , 3 ) ;
TQLabel * headingLabel = new TQLabel ( TQString ( " <b>%1</b> " ) . tq arg( i18n ( " Select works to be uninstalled " ) ) , page ) ;
tq layout- > addMultiCellWidget ( headingLabel , 1 , 1 , 0 , 3 ) ;
m_removeModuleListView = new CSwordSetupModuleListView ( page , false ) ;
layout- > addMultiCellWidget ( m_removeModuleListView , 2 , 2 , 0 , 3 ) ;
tq layout- > addMultiCellWidget ( m_removeModuleListView , 2 , 2 , 0 , 3 ) ;
m_removeRemoveButton = new TQPushButton ( i18n ( " Remove selected work(s) " ) , page ) ;
m_removeRemoveButton - > setIconSet ( SmallIcon ( " edittrash " , 16 ) ) ;
layout- > addWidget ( m_removeRemoveButton , 3 , 3 , TQt : : AlignRight ) ;
tq layout- > addWidget ( m_removeRemoveButton , 3 , 3 , TQt : : AlignRight ) ;
connect ( m_removeRemoveButton , TQT_SIGNAL ( clicked ( ) ) ,
this , TQT_SLOT ( slot_doRemoveModules ( ) ) ) ;
@ -379,10 +379,10 @@ the module remote installation feature!</b>")
sword : : InstallSource is = BTInstallMgr : : Tool : : RemoteConfig : : source ( & mgr , source ) ;
if ( BTInstallMgr : : Tool : : RemoteConfig : : isRemoteSource ( & is ) ) {
url = TQString ( " ftp://%1%2 " ) . arg( is . source . c_str ( ) ) . arg( is . directory . c_str ( ) ) ;
url = TQString ( " ftp://%1%2 " ) . tq arg( is . source . c_str ( ) ) . tq arg( is . directory . c_str ( ) ) ;
}
else {
url = TQString ( " %1 " ) . arg( is . directory . c_str ( ) ) ;
url = TQString ( " %1 " ) . tq arg( is . directory . c_str ( ) ) ;
}
m_sourceLabel - > setText ( url ) ;
@ -405,7 +405,7 @@ the module remote installation feature!</b>")
}
const TQString message = i18n ( " You selected the following work(s): %1. \n \n "
" Do you really want to remove them from your system? " ) . arg( moduleList . join ( " , " ) ) ;
" Do you really want to remove them from your system? " ) . tq arg( moduleList . join ( " , " ) ) ;
if ( ( KMessageBox : : warningYesNo ( 0 , message , i18n ( " Warning " ) ) = = KMessageBox : : Yes ) ) { //Yes was pressed.
sword : : InstallMgr installMgr ;
@ -424,7 +424,7 @@ the module remote installation feature!</b>")
prefixPath = prefixPath . remove ( prefixPath . find ( dataPath ) , dataPath . length ( ) ) ;
}
else { //fall back to default Sword config path
prefixPath = TQString : : fromLatin1( backend ( ) - > prefixPath ) ;
prefixPath = TQString : : tq fromLatin1( backend ( ) - > prefixPath ) ;
}
sword : : SWMgr * mgr = mgrDict [ prefixPath ] ;
@ -612,16 +612,16 @@ the module remote installation feature!</b>")
if ( ! m_installModuleListPage ) { //the widgets are not yet created
m_installModuleListPage = new TQWidget ( 0 ) ;
TQGridLayout * layout = new TQGridLayout ( m_installModuleListPage , 7 , 2 ) ;
layout- > setMargin ( 5 ) ;
layout- > setSpacing ( 10 ) ;
TQGridLayout * tq layout = new TQGridLayout ( m_installModuleListPage , 7 , 2 ) ;
tq layout- > setMargin ( 5 ) ;
tq layout- > setSpacing ( 10 ) ;
TQLabel * installLabel = CToolClass : : explanationLabel ( m_installModuleListPage ,
i18n ( " Install/update works - Step 2 " ) ,
i18n ( " Please choose the works which should be installed and/or updated and click the install button. " )
) ;
layout- > addMultiCellWidget ( installLabel , 0 , 0 , 0 , 1 ) ;
layout- > setRowStretch ( 0 , 0 ) ;
tq layout- > addMultiCellWidget ( installLabel , 0 , 0 , 0 , 1 ) ;
tq layout- > setRowStretch ( 0 , 0 ) ;
m_installWidgetStack - > addWidget ( m_installModuleListPage ) ;
m_installModuleListPage - > setMinimumSize ( 500 , 400 ) ;
@ -631,9 +631,9 @@ the module remote installation feature!</b>")
sword : : InstallSource is = BTInstallMgr : : Tool : : RemoteConfig : : source ( & iMgr , currentInstallSource ( ) ) ;
m_installModuleListView = new CSwordSetupModuleListView ( m_installModuleListPage , true , & is ) ;
layout- > addMultiCellWidget ( m_installModuleListView , 1 , 6 , 0 , 1 ) ;
layout- > setColStretch ( 0 , 5 ) ;
layout- > setRowStretch ( 1 , 5 ) ;
tq layout- > addMultiCellWidget ( m_installModuleListView , 1 , 6 , 0 , 1 ) ;
tq layout- > setColStretch ( 0 , 5 ) ;
tq layout- > setRowStretch ( 1 , 5 ) ;
connect ( m_installModuleListView , TQT_SIGNAL ( selectedModulesChanged ( ) ) , TQT_SLOT ( slot_installModulesChanged ( ) ) ) ;
}
@ -696,7 +696,7 @@ the module remote installation feature!</b>")
}
const TQString message = i18n ( " You selected the following works: %1. \n \n \
Do you really want to install them on your system ? " ). arg(moduleList.join(" , " ));
Do you really want to install them on your system ? " ). tq arg(moduleList.join(" , " ));
if ( ( KMessageBox : : warningYesNo ( 0 , message , i18n ( " Warning " ) ) = = KMessageBox : : Yes ) ) { //Yes was pressed.
BTInstallMgr iMgr ;
@ -758,7 +758,7 @@ the module remote installation feature!</b>")
//prefixPath = prefixPath.replace(dataPath, ""); //old code working with TQt 3.2
}
else {
prefixPath = TQString : : fromLatin1( backend ( ) - > prefixPath ) ;
prefixPath = TQString : : tq fromLatin1( backend ( ) - > prefixPath ) ;
}
sword : : SWMgr mgr ( prefixPath . latin1 ( ) ) ;
@ -795,7 +795,7 @@ the module remote installation feature!</b>")
void CSwordSetupDialog : : installCompleted ( const int total , const int /* file */ ) {
if ( m_progressDialog ) {
m_progressDialog - > progressBar ( ) - > setProgress ( total + 100 * m_installedModuleCount ) ;
m_progressDialog - > setLabel ( i18n ( " [%1]: %2% complete " ) . arg( m_installingModule ) . arg( total ) ) ;
m_progressDialog - > setLabel ( i18n ( " [%1]: %2% complete " ) . tq arg( m_installingModule ) . tq arg( total ) ) ;
}
KApplication : : kApplication ( ) - > processEvents ( ) ;
}