diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:27:17 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:27:17 -0500 |
commit | 883a1fc629f00e9a41efad8514afd1ccf259d8c2 (patch) | |
tree | 53191c33748f9cd949a2eb86a64fbedc86c5ac75 /kftpgrabber/src/mainwindow.cpp | |
parent | 1385303ea163214e30825730ac0fbcc27f9634aa (diff) | |
download | kftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.tar.gz kftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.zip |
Convert to TDE R14 API
Diffstat (limited to 'kftpgrabber/src/mainwindow.cpp')
-rw-r--r-- | kftpgrabber/src/mainwindow.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/kftpgrabber/src/mainwindow.cpp b/kftpgrabber/src/mainwindow.cpp index b77f0ea..a98d5f2 100644 --- a/kftpgrabber/src/mainwindow.cpp +++ b/kftpgrabber/src/mainwindow.cpp @@ -34,29 +34,29 @@ * files in the program, then also delete it here. */ -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qtextedit.h> -#include <qtabwidget.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qthread.h> - -#include <kapplication.h> -#include <kmdimainfrm.h> -#include <kmdichildview.h> -#include <kmenubar.h> -#include <kpopupmenu.h> -#include <ktoolbar.h> +#include <ntqlabel.h> +#include <ntqlayout.h> +#include <ntqpainter.h> +#include <ntqtextedit.h> +#include <ntqtabwidget.h> +#include <ntqhbox.h> +#include <ntqvbox.h> +#include <ntqthread.h> + +#include <tdeapplication.h> +#include <tdemdimainfrm.h> +#include <tdemdichildview.h> +#include <tdemenubar.h> +#include <tdepopupmenu.h> +#include <tdetoolbar.h> #include <kiconloader.h> #include <kdialogbase.h> -#include <kfiledetailview.h> -#include <kmessagebox.h> +#include <tdefiledetailview.h> +#include <tdemessagebox.h> #include <klineeditdlg.h> #include <kstatusbar.h> -#include <klocale.h> -#include <kio/job.h> +#include <tdelocale.h> +#include <tdeio/job.h> #include <kpassdlg.h> #include <ksslpkcs12.h> #include <kstandarddirs.h> @@ -98,14 +98,14 @@ using namespace KFTPGrabberBase; MainWindow::MainWindow() - : KMainWindow() + : TDEMainWindow() { // Init the API KFTPAPI::getInstance()->m_mainWindow = this; // Set the shell's ui resource file setXMLFile("kftpgrabberui.rc"); - connect(KApplication::kApplication(), SIGNAL(shutDown()), this, SLOT(appShutdown())); + connect(TDEApplication::kApplication(), SIGNAL(shutDown()), this, SLOT(appShutdown())); // Restore size and position resize(KFTPCore::Config::size()); @@ -146,17 +146,17 @@ MainWindow::MainWindow() KFTPSession::Manager::self()->spawnLocalSession(KFTPSession::RightSide); // Load bookmarks - QTimer::singleShot(500, this, SLOT(slotReadBookmarks())); + TQTimer::singleShot(500, this, SLOT(slotReadBookmarks())); // Check for the uirc file - if (KGlobal::dirs()->findResource("appdata", xmlFile()) == QString::null) { + if (TDEGlobal::dirs()->findResource("appdata", xmlFile()) == TQString::null) { KMessageBox::error(0, i18n("<qt>Unable to find %1 XML GUI descriptor file. Please check that you have installed the application correctly! If you have any questions please ask on %2.<br><br><b>Warning:</b> Current GUI will be incomplete!</qt>").arg(xmlFile()).arg("irc.freenode.net/#kftpgrabber")); } createGUI(0); // Auto-save toolbar/menubar/statusbar settings - setAutoSaveSettings(QString::fromLatin1("MainWindow"), false); + setAutoSaveSettings(TQString::fromLatin1("MainWindow"), false); } void MainWindow::slotReadBookmarks() @@ -188,7 +188,7 @@ void MainWindow::appShutdown() bool MainWindow::queryClose() { - if(KApplication::kApplication()->sessionSaving()) { + if(TDEApplication::kApplication()->sessionSaving()) { m_actions->m_closeApp = true; } @@ -200,7 +200,7 @@ bool MainWindow::queryClose() */ // Compute size and position of the pixmap to be grabbed: - QPoint g = KFTPWidgets::SystemTray::self()->mapToGlobal(KFTPWidgets::SystemTray::self()->pos()); + TQPoint g = KFTPWidgets::SystemTray::self()->mapToGlobal(KFTPWidgets::SystemTray::self()->pos()); int desktopWidth = kapp->desktop()->width(); int desktopHeight = kapp->desktop()->height(); int tw = KFTPWidgets::SystemTray::self()->width(); @@ -215,18 +215,18 @@ bool MainWindow::queryClose() if ( y + h > desktopHeight ) y = desktopHeight - h; // Grab the desktop and draw a circle arround the icon: - QPixmap shot = QPixmap::grabWindow( qt_xrootwin(), x, y, w, h ); - QPainter painter( &shot ); + TQPixmap shot = TQPixmap::grabWindow( tqt_xrootwin(), x, y, w, h ); + TQPainter painter( &shot ); const int MARGINS = 6; const int WIDTH = 3; int ax = g.x() - x - MARGINS -1; int ay = g.y() - y - MARGINS -1; - painter.setPen( QPen( Qt::red, WIDTH ) ); + painter.setPen( TQPen( TQt::red, WIDTH ) ); painter.drawArc( ax, ay, tw + 2*MARGINS, th + 2*MARGINS, 0, 16*360 ); painter.end(); // Associate source to image and show the dialog: - QMimeSourceFactory::defaultFactory()->setPixmap( "systray_shot", shot ); + TQMimeSourceFactory::defaultFactory()->setPixmap( "systray_shot", shot ); KMessageBox::information( this, i18n( "<p>Closing the main window will keep KFTPGrabber running in the system tray. " "Use <b>Quit</b> from the <b>KFTPGrabber</b> menu to quit the application.</p>" @@ -263,7 +263,7 @@ MainWindow::~MainWindow() void MainWindow::initTrafficGraph() { // Setup traffic graph - m_graphTimer = new QTimer(this); + m_graphTimer = new TQTimer(this); connect(m_graphTimer, SIGNAL(timeout()), this, SLOT(slotUpdateTrafficGraph())); m_graphTimer->start(1000); @@ -271,8 +271,8 @@ void MainWindow::initTrafficGraph() m_trafficGraph = new KFTPWidgets::TrafficGraph(0, "graph"); m_trafficGraph->setShowLabels(true); - m_trafficGraph->addBeam(QColor(255, 0, 0)); - m_trafficGraph->addBeam(QColor(0, 0, 255)); + m_trafficGraph->addBeam(TQColor(255, 0, 0)); + m_trafficGraph->addBeam(TQColor(0, 0, 255)); m_trafficGraph->repaint(); } @@ -291,17 +291,17 @@ void MainWindow::initBookmarkMenu() { // Bookmarks menu if (!m_bookmarkMenu) - m_bookmarkMenu = new KActionMenu(i18n("Bookmarks"), 0, actionCollection(), "bookmarks"); + m_bookmarkMenu = new TDEActionMenu(i18n("Bookmarks"), 0, actionCollection(), "bookmarks"); else m_bookmarkMenu->popupMenu()->clear(); // Zeroconf menu if (!m_zeroconfMenu) - m_zeroconfMenu = new KActionMenu(i18n("FTP Sites Near Me")); + m_zeroconfMenu = new TDEActionMenu(i18n("FTP Sites Near Me")); // Wallet menu if (!m_walletMenu) - m_walletMenu = new KActionMenu(i18n("Sites In KWallet"), loadSmallIcon("wallet_open")); + m_walletMenu = new TDEActionMenu(i18n("Sites In KWallet"), loadSmallIcon("wallet_open")); m_bookmarkMenu->popupMenu()->insertItem(loadSmallIcon("bookmark"), i18n("Edit Bookmarks..."), 1); m_bookmarkMenu->popupMenu()->connectItem(1, this, SLOT(showBookmarkEditor())); @@ -323,10 +323,10 @@ void MainWindow::initBookmarkMenu() void MainWindow::initStatusBar() { statusBar()->insertItem(i18n("idle"), 1, 1); - statusBar()->setItemAlignment(1, Qt::AlignLeft); + statusBar()->setItemAlignment(1, TQt::AlignLeft); - statusBar()->insertItem(i18n("Download: %1/s").arg(KIO::convertSize(KFTPQueue::Manager::self()->getDownloadSpeed())), 2); - statusBar()->insertItem(i18n("Upload: %1/s").arg(KIO::convertSize(KFTPQueue::Manager::self()->getUploadSpeed())), 3); + statusBar()->insertItem(i18n("Download: %1/s").arg(TDEIO::convertSize(KFTPQueue::Manager::self()->getDownloadSpeed())), 2); + statusBar()->insertItem(i18n("Upload: %1/s").arg(TDEIO::convertSize(KFTPQueue::Manager::self()->getUploadSpeed())), 3); } void MainWindow::initSidebars() @@ -361,23 +361,23 @@ void MainWindow::initSidebars() void MainWindow::initMainView() { - setCentralWidget(new QWidget(this, "qt_central_widget")); + setCentralWidget(new TQWidget(this, "qt_central_widget")); - QHBoxLayout *mainLayout = new QHBoxLayout(centralWidget(), 0, 0, "tLayout"); + TQHBoxLayout *mainLayout = new TQHBoxLayout(centralWidget(), 0, 0, "tLayout"); // Create the sidebars initSidebars(); mainLayout->addWidget(m_bottomSidebar); - QSplitter *splitter = new QSplitter(m_leftSidebar->content()); + TQSplitter *splitter = new TQSplitter(m_leftSidebar->content()); // Session layouts - QWidget *box_1 = new QWidget(splitter); - QWidget *box_2 = new QWidget(splitter); + TQWidget *box_1 = new TQWidget(splitter); + TQWidget *box_2 = new TQWidget(splitter); - QHBoxLayout *lay_1 = new QHBoxLayout(box_1); - QHBoxLayout *lay_2 = new QHBoxLayout(box_2); + TQHBoxLayout *lay_1 = new TQHBoxLayout(box_1); + TQHBoxLayout *lay_2 = new TQHBoxLayout(box_2); KFTPTabWidget *leftTabs = new KFTPTabWidget(box_1, "TabWidgetLeft"); KFTPTabWidget *rightTabs = new KFTPTabWidget(box_2, "TabWidgetRight"); @@ -389,7 +389,7 @@ void MainWindow::initMainView() lay_2->addWidget(rightTabs); // Create the session manager - new KFTPSession::Manager(this, new QTabWidget(0, "logs"), leftTabs, rightTabs); + new KFTPSession::Manager(this, new TQTabWidget(0, "logs"), leftTabs, rightTabs); // Add some sidebars that can't be added before the session manager is created m_bottomSidebar->addSidebar(new KFTPWidgets::ThreadView(0, "threads"), i18n("Threads"), "socket"); @@ -400,15 +400,15 @@ void MainWindow::initMainView() void MainWindow::slotUpdateStatusBar() { // Status bar - statusBar()->changeItem(i18n("Download: %1/s").arg(KIO::convertSize(KFTPQueue::Manager::self()->getDownloadSpeed())), 2); - statusBar()->changeItem(i18n("Upload: %1/s").arg(KIO::convertSize(KFTPQueue::Manager::self()->getUploadSpeed())), 3); + statusBar()->changeItem(i18n("Download: %1/s").arg(TDEIO::convertSize(KFTPQueue::Manager::self()->getDownloadSpeed())), 2); + statusBar()->changeItem(i18n("Upload: %1/s").arg(TDEIO::convertSize(KFTPQueue::Manager::self()->getUploadSpeed())), 3); } void MainWindow::slotUpdateTrafficGraph() { // Update the traffic graph if (m_trafficGraph) { - QValueList<double> trafficList; + TQValueList<double> trafficList; trafficList.append((double) KFTPQueue::Manager::self()->getDownloadSpeed() / 1024); trafficList.append((double) KFTPQueue::Manager::self()->getUploadSpeed() / 1024); @@ -416,7 +416,7 @@ void MainWindow::slotUpdateTrafficGraph() } } -void MainWindow::slotQuickConnect(const QString &title, const QString &host, int port) +void MainWindow::slotQuickConnect(const TQString &title, const TQString &host, int port) { // Create/get the new dialog KFTPWidgets::QuickConnectDialog *quickConnect = new KFTPWidgets::QuickConnectDialog(this); |