diff options
author | Slávek Banko <[email protected]> | 2016-03-25 20:06:45 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2016-03-25 20:06:45 +0100 |
commit | 88b7febc2393324ee14940c1c41a8ddc342c35f6 (patch) | |
tree | b9a917fd3a40988e6e0134490f5357e5335c1c70 /sidebar/dndlistbox.cpp | |
parent | 2ee99ab520931c5efe91123c85ba10064a45e95d (diff) | |
download | tde-style-baghira-88b7febc2393324ee14940c1c41a8ddc342c35f6.tar.gz tde-style-baghira-88b7febc2393324ee14940c1c41a8ddc342c35f6.zip |
Initial TDE conversion
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'sidebar/dndlistbox.cpp')
-rw-r--r-- | sidebar/dndlistbox.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/sidebar/dndlistbox.cpp b/sidebar/dndlistbox.cpp index 4f8928d..aac7484 100644 --- a/sidebar/dndlistbox.cpp +++ b/sidebar/dndlistbox.cpp @@ -4,17 +4,17 @@ #include <kurl.h> #include <tqstrlist.h> #include <tqtimer.h> -#include <kapplication.h> -#include <klocale.h> -#include <kfileitem.h> -#include <kpopupmenu.h> +#include <tdeapplication.h> +#include <tdelocale.h> +#include <tdefileitem.h> +#include <tdepopupmenu.h> #include <kicondialog.h> #include <kiconloader.h> #include <klineedit.h> #include <kprocess.h> #include <kurlrequester.h> #include <kstandarddirs.h> -#include <kwin.h> +#include <twin.h> #include <tqclipboard.h> #include "listboxlink.h" #include "linkconfig.h" @@ -37,12 +37,12 @@ #define MEDIA_PROPS 12 #define MEDIALIST_PROPS 13 -ResizingLinkBox::ResizingLinkBox( TQWidget * parent, const char * name, WFlags f ) : KListBox( parent, name, f) +ResizingLinkBox::ResizingLinkBox( TQWidget * parent, const char * name, WFlags f ) : TDEListBox( parent, name, f) { - KConfig config(TQDir::homeDirPath() + "/.qt/baghirarc"); + TDEConfig config(TQDir::homeDirPath() + "/.qt/baghirarc"); config.setGroup("Sidebar"); size_ = config.readNumEntry (TQString(name) + "_IconSize", 48); - popupMenu = new KPopupMenu; + popupMenu = new TDEPopupMenu; popupMenu->insertTitle (i18n("Icon Size"),122,122); popupMenu->insertItem("16x16", this, SLOT(setIconSize(int)),0,16,123); popupMenu->insertItem("22x22", this, SLOT(setIconSize(int)),0,22,124); @@ -54,14 +54,14 @@ ResizingLinkBox::ResizingLinkBox( TQWidget * parent, const char * name, WFlags f void ResizingLinkBox::insertItem( const TQListBoxItem *lbi, int index ) { - KListBox::insertItem( lbi, index ); + TDEListBox::insertItem( lbi, index ); if (height() <= numRows()*itemHeight()) emit itemNumberChanged(TRUE); } void ResizingLinkBox::insertItem( const TQListBoxItem *lbi, const TQListBoxItem *after ) { - KListBox::insertItem( lbi, after ); + TDEListBox::insertItem( lbi, after ); if (height() <= numRows()*itemHeight()) emit itemNumberChanged(TRUE); } @@ -75,7 +75,7 @@ void ResizingLinkBox::insertItem( const TQString & icon, const TQString & title, void ResizingLinkBox::removeItem( int index ) { blockSignals ( true ); - KListBox::removeItem(index); + TDEListBox::removeItem(index); blockSignals ( false ); emit itemNumberChanged(FALSE); } @@ -83,7 +83,7 @@ void ResizingLinkBox::removeItem( int index ) void ResizingLinkBox::setIconSize(int size) { size_ = size; - KConfig *config = new KConfig(TQDir::homeDirPath() + "/.qt/baghirarc"); + TDEConfig *config = new TDEConfig(TQDir::homeDirPath() + "/.qt/baghirarc"); config->setGroup("Sidebar"); config->writeEntry (TQString(name()) + "_IconSize", size); config->sync(); @@ -102,14 +102,14 @@ void ResizingLinkBox::setIconSize(int size) { insertItem( new ListBoxLink(runner->icon(), size, runner->text(), runner->URL()), i ); } - KListBox::removeItem(i+1); + TDEListBox::removeItem(i+1); } blockSignals ( false ); } void ResizingLinkBox::mousePressEvent ( TQMouseEvent *mpe ) { - KListBox::mousePressEvent( mpe ); + TDEListBox::mousePressEvent( mpe ); } void ResizingLinkBox::mouseReleaseEvent ( TQMouseEvent *mpe ) @@ -118,27 +118,27 @@ void ResizingLinkBox::mouseReleaseEvent ( TQMouseEvent *mpe ) { ListBoxLink *link = (ListBoxLink*)itemAt(mpe->pos()); if (isSelected(link)) emit clicked(link); - KListBox::mousePressEvent( mpe ); + TDEListBox::mousePressEvent( mpe ); return; } - KListBox::mouseReleaseEvent( mpe ); + TDEListBox::mouseReleaseEvent( mpe ); } void ResizingLinkBox::contentsWheelEvent ( TQWheelEvent * we ) { if (we->state() == TQt::ControlButton) - KListBox::contentsWheelEvent ( we ); + TDEListBox::contentsWheelEvent ( we ); else emit scrolled(0, -we->delta()); } MediaListBox::MediaListBox( TQWidget * parent, const char * name, WFlags f ) : ResizingLinkBox(parent, name, f), DCOPObject("BaghiraSidebarIface") { - KConfig config(TQDir::homeDirPath() + "/.qt/baghirarc"); + TDEConfig config(TQDir::homeDirPath() + "/.qt/baghirarc"); config.setGroup("Sidebar"); hiddenDevices = config.readListEntry("HiddenDevices"); currentFloppy = 0L; - devicePopup = new KPopupMenu(this); + devicePopup = new TDEPopupMenu(this); devicePopup->setCheckable ( true ); popupMenu->insertItem(i18n("Device List"), devicePopup, 1, 0); popupMenu->insertSeparator( 0 ); @@ -151,7 +151,7 @@ MediaListBox::MediaListBox( TQWidget * parent, const char * name, WFlags f ) : R insertItem(new ListBoxDevice("network", size_, i18n("Network"), "lan:/localhost", "", "", TRUE, FALSE, FALSE)); #endif insertItem(new ListBoxDevice("hdd_mount", size_, i18n("Startvolume"), TQDir::rootDirPath(), "", "", TRUE, FALSE, FALSE)); - client = KApplication::dcopClient(); + client = TDEApplication::dcopClient(); client->connectDCOPSignal("kded", "mediamanager", "mediumAdded(TQString)", "BaghiraSidebarIface", "mediumAdded(TQString)", FALSE); client->connectDCOPSignal("kded", "mediamanager", "mediumRemoved(TQString)", "BaghiraSidebarIface", "mediumRemoved(const TQString)", FALSE); client->connectDCOPSignal("kded", "mediamanager", "mediumChanged(TQString)", "BaghiraSidebarIface", "mediumChanged(TQString)", FALSE); @@ -206,7 +206,7 @@ MediaListBox::~MediaListBox() ListBoxDevice *runner; for ( runner = deviceList.first(); runner; runner = deviceList.next() ) hiddenDevices.append(runner->name()); - KConfig config(TQDir::homeDirPath() + "/.qt/baghirarc"); + TDEConfig config(TQDir::homeDirPath() + "/.qt/baghirarc"); config.setGroup("Sidebar"); config.writeEntry("HiddenDevices", hiddenDevices); } @@ -221,9 +221,9 @@ void MediaListBox::kfloppy() { if (currentFloppy) { - KProcess proc; + TDEProcess proc; proc << "kfloppy" << currentFloppy->mountPoint(); - proc.start(KProcess::DontCare); + proc.start(TDEProcess::DontCare); proc.detach(); currentFloppy = 0L; } @@ -433,11 +433,11 @@ void MediaListBox::mousePressEvent ( TQMouseEvent *mpe ) int dy = itemRect(device).y(); if ((device->removable() || device->ejectable()) && device->mounted() && mpe->y() > dy+11 && mpe->y() < dy+33) { - KProcess proc; + TDEProcess proc; device->ejectable()? proc << "kdeeject" /*<< "-q"*/ << device->mountPoint(): proc << "umount" << device->mountPoint(); // umount? - proc.start(KProcess::DontCare); + proc.start(TDEProcess::DontCare); proc.detach(); return; } |