summaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
commitaa0726b20f398264f0a2abc60215be044b106f9c (patch)
tree070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/mainwindow.cpp
parentd3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff)
downloadbasket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz
basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip
TQt4 port basket
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ce8bf0f..16b3fe3 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -18,43 +18,43 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qtabwidget.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qcursor.h>
-#include <qwhatsthis.h>
-#include <qvaluelist.h>
-#include <qregexp.h>
-#include <qbuttongroup.h>
+#include <tqtabwidget.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqcursor.h>
+#include <tqwhatsthis.h>
+#include <tqvaluelist.h>
+#include <tqregexp.h>
+#include <tqbuttongroup.h>
#include <kstringhandler.h>
#include <ksqueezedtextlabel.h>
-#include <qpoint.h>
-#include <qpixmap.h>
-#include <qinputdialog.h>
+#include <tqpoint.h>
+#include <tqpixmap.h>
+#include <tqinputdialog.h>
#include <kpopupmenu.h>
#include <kiconloader.h>
#include <kiconeffect.h>
-#include <qiconset.h>
+#include <tqiconset.h>
#include <kaction.h>
#include <kapp.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kedittoolbar.h>
#include <kdebug.h>
-#include <qsignalmapper.h>
-#include <qstringlist.h>
+#include <tqsignalmapper.h>
+#include <tqstringlist.h>
-#include <qpainter.h>
-#include <qstyle.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
#include <kglobalsettings.h>
#include <kstandarddirs.h>
-#include <qdir.h>
-#include <qstringlist.h>
+#include <tqdir.h>
+#include <tqstringlist.h>
#include <kmessagebox.h>
#include <kstatusbar.h>
-#include <qtimer.h>
-#include <qaction.h>
+#include <tqtimer.h>
+#include <tqaction.h>
#include <kstdaccel.h>
#include <kglobalaccel.h>
#include <kkeydialog.h>
@@ -64,7 +64,7 @@
#include <kaboutdata.h>
#include <kdeversion.h>
-#include <qdesktopwidget.h>
+#include <tqdesktopwidget.h>
#include <kwin.h>
#include <kprogress.h>
@@ -100,8 +100,8 @@
/** Container */
-MainWindow::MainWindow(QWidget *parent, const char *name)
- : KMainWindow(parent, name != 0 ? name : "MainWindow"), m_settings(0), m_quit(false)
+MainWindow::MainWindow(TQWidget *tqparent, const char *name)
+ : KMainWindow(tqparent, name != 0 ? name : "MainWindow"), m_settings(0), m_quit(false)
{
BasketStatusBar* bar = new BasketStatusBar(statusBar());
m_baskets = new BNPView(this, "BNPViewApp", this, actionCollection(), bar);
@@ -111,11 +111,11 @@ MainWindow::MainWindow(QWidget *parent, const char *name)
statusBar()->show();
statusBar()->setSizeGripEnabled(true);
- setAutoSaveSettings(/*groupName=*/QString::fromLatin1("MainWindow"), /*saveWindowSize=*//*FIXME:false:Why was it false??*/true);
+ setAutoSaveSettings(/*groupName=*/TQString::tqfromLatin1("MainWindow"), /*saveWindowSize=*//*FIXME:false:Why was it false??*/true);
// m_actShowToolbar->setChecked( toolBar()->isShown() );
m_actShowStatusbar->setChecked( statusBar()->isShown() );
- connect( m_baskets, SIGNAL(setWindowCaption(const QString &)), this, SLOT(setCaption(const QString &)));
+ connect( m_baskets, TQT_SIGNAL(setWindowCaption(const TQString &)), this, TQT_SLOT(setCaption(const TQString &)));
// InlineEditors::instance()->richTextToolBar();
setStandardToolBarMenuEnabled(true);
@@ -132,23 +132,23 @@ MainWindow::~MainWindow()
void MainWindow::setupActions()
{
- actQuit = KStdAction::quit( this, SLOT(quit()), actionCollection() );
+ actQuit = KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT(quit()), actionCollection() );
new KAction(i18n("Minimize"), "", 0,
- this, SLOT(minimizeRestore()), actionCollection(), "minimizeRestore" );
+ TQT_TQOBJECT(this), TQT_SLOT(minimizeRestore()), actionCollection(), "minimizeRestore" );
/** Settings : ************************************************************/
-// m_actShowToolbar = KStdAction::showToolbar( this, SLOT(toggleToolBar()), actionCollection());
- m_actShowStatusbar = KStdAction::showStatusbar( this, SLOT(toggleStatusBar()), actionCollection());
+// m_actShowToolbar = KStdAction::showToolbar( TQT_TQOBJECT(this), TQT_SLOT(toggleToolBar()), actionCollection());
+ m_actShowStatusbar = KStdAction::showStatusbar( TQT_TQOBJECT(this), TQT_SLOT(toggleStatusBar()), actionCollection());
// m_actShowToolbar->setCheckedState( KGuiItem(i18n("Hide &Toolbar")) );
- (void) KStdAction::keyBindings( this, SLOT(showShortcutsSettingsDialog()), actionCollection() );
+ (void) KStdAction::keyBindings( TQT_TQOBJECT(this), TQT_SLOT(showShortcutsSettingsDialog()), actionCollection() );
- (void) KStdAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection() );
+ (void) KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configureToolbars()), actionCollection() );
- //KAction *actCfgNotifs = KStdAction::configureNotifications(this, SLOT(configureNotifications()), actionCollection() );
+ //KAction *actCfgNotifs = KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection() );
//actCfgNotifs->setEnabled(false); // Not yet implemented !
- actAppConfig = KStdAction::preferences( this, SLOT(showSettingsDialog()), actionCollection() );
+ actAppConfig = KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT(showSettingsDialog()), actionCollection() );
}
/*void MainWindow::toggleToolBar()
@@ -176,7 +176,7 @@ void MainWindow::configureToolbars()
saveMainWindowSettings( KGlobal::config(), autoSaveGroup() );
KEditToolbar dlg(actionCollection());
- connect( &dlg, SIGNAL(newToolbarConfig()), this, SLOT(slotNewToolbarConfig()) );
+ connect( &dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(slotNewToolbarConfig()) );
dlg.exec();
}
@@ -193,14 +193,14 @@ void MainWindow::slotNewToolbarConfig() // This is called when OK or Apply is cl
createGUI("basketui.rc"); // TODO: Reconnect tags menu aboutToShow() ??
if (!Global::bnpView->isPart())
Global::bnpView->connectTagsMenu(); // The Tags menu was created again!
- plugActionList( QString::fromLatin1("go_baskets_list"), actBasketsList);
+ plugActionList( TQString::tqfromLatin1("go_baskets_list"), actBasketsList);
applyMainWindowSettings( KGlobal::config(), autoSaveGroup() );
}
void MainWindow::showSettingsDialog()
{
if(m_settings == 0)
- m_settings = new KSettings::Dialog(kapp->activeWindow());
+ m_settings = new KSettings::Dialog(TQT_TQWIDGET(kapp->activeWindow()));
if (Global::mainWindow()) {
m_settings->dialog()->showButton(KDialogBase::Help, false); // Not implemented!
m_settings->dialog()->showButton(KDialogBase::Default, false); // Not implemented!
@@ -221,13 +221,13 @@ void MainWindow::polish()
bool shouldSave = false;
// If position and size has never been set, set nice ones:
- // - Set size to sizeHint()
+ // - Set size to tqsizeHint()
// - Keep the window manager placing the window where it want and save this
if (Settings::mainWindowSize().isEmpty()) {
// std::cout << "Main Window Position: Initial Set in show()" << std::endl;
int defaultWidth = kapp->desktop()->width() * 5 / 6;
int defaultHeight = kapp->desktop()->height() * 5 / 6;
- resize(defaultWidth, defaultHeight); // sizeHint() is bad (too small) and we want the user to have a good default area size
+ resize(defaultWidth, defaultHeight); // tqsizeHint() is bad (too small) and we want the user to have a good default area size
shouldSave = true;
} else {
// std::cout << "Main Window Position: Recall in show(x="
@@ -251,7 +251,7 @@ void MainWindow::polish()
}
}
-void MainWindow::resizeEvent(QResizeEvent *event)
+void MainWindow::resizeEvent(TQResizeEvent *event)
{
// std::cout << "Main Window Position: Save size in resizeEvent(width=" << size().width() << ", height=" << size().height() << ") ; isMaximized="
// << (isMaximized() ? "true" : "false") << std::endl;
@@ -263,7 +263,7 @@ void MainWindow::resizeEvent(QResizeEvent *event)
KMainWindow::resizeEvent(event);
}
-void MainWindow::moveEvent(QMoveEvent *event)
+void MainWindow::moveEvent(TQMoveEvent *event)
{
// std::cout << "Main Window Position: Save position in moveEvent(x=" << pos().x() << ", y=" << pos().y() << ")" << std::endl;
Settings::setMainWindowPosition(pos());
@@ -307,7 +307,7 @@ bool MainWindow::queryClose()
bool MainWindow::askForQuit()
{
- QString message = i18n("<p>Do you really want to quit %1?</p>").arg(kapp->aboutData()->programName());
+ TQString message = i18n("<p>Do you really want to quit %1?</p>").tqarg(kapp->aboutData()->programName());
if (Settings::useSystray())
message += i18n("<p>Notice that you do not have to quit the application before ending your KDE session. "
"If you end your session while the application is still running, the application will be reloaded the next time you log in.</p>");