author | zecke <zecke> | 2003-09-01 16:33:33 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-09-01 16:33:33 (UTC) |
commit | aa1be5c49b77368999f068222f5f4e1f0d1ace0d (patch) (side-by-side diff) | |
tree | 63f4283d3e68e6b4c1d0a81dd306276813c1a0c8 | |
parent | 4e7703b3055562d93dc2d993f47888a3538429d2 (diff) | |
download | opie-aa1be5c49b77368999f068222f5f4e1f0d1ace0d.zip opie-aa1be5c49b77368999f068222f5f4e1f0d1ace0d.tar.gz opie-aa1be5c49b77368999f068222f5f4e1f0d1ace0d.tar.bz2 |
port to OSplitter but QComboBox is a sucker
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 14 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 4 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 11 |
3 files changed, 15 insertions, 14 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 77dca49..91318f1 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -3,33 +3,33 @@ ------------------- ** Created: Sat Mar 9 23:33:09 2002 copyright : (C) 2002 by ljp email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #define DEVELOPERS_VERSION #include "advancedfm.h" // #include <opie/ofileselector.h> // #include <opie/ofiledialog.h> -#include <opie/otabwidget.h> +#include <opie/osplitter.h> #include <qpe/filemanager.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/mimetype.h> #include <qpe/applnk.h> #include <qpe/ir.h> #include <qpe/resource.h> #include <qpe/menubutton.h> #include <qdatetime.h> #include <qfile.h> #include <qcombobox.h> #include <qpopupmenu.h> #include <qlistview.h> @@ -205,36 +205,36 @@ void AdvancedFm::populateView() } closedir(dir); } thisView->setSorting( 3,FALSE); fillCombo( (const QString &) path ); } void AdvancedFm::rePopulate() { int tmpTab = whichTab; qDebug("%d", tmpTab); for(int i =1; i < 3; i++) { - TabWidget->setCurrentTab(i - 1); + TabWidget->setCurrentWidget(i - 1); populateView(); } - TabWidget->setCurrentTab( tmpTab - 1); + TabWidget->setCurrentWidget( tmpTab - 1); } void AdvancedFm::ListClicked(QListViewItem *selectedItem) { if(selectedItem) { QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); strSize=strSize.stripWhiteSpace(); bool isDirectory = false; QString strItem2; if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 )//if symlink { strItem2 = dealWithSymName((const QString&)strItem); if(QDir(strItem2).exists() ) @@ -263,39 +263,39 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *, const QPoint& , int ) case 1: { if(renameBox != 0 ) { cancelRename(); } } break; case 2: menuTimer.start( 500, TRUE ); break; }; } void AdvancedFm::switchToLocalTab() { - TabWidget->setCurrentTab(0); + TabWidget->setCurrentWidget(0); Local_View->setFocus(); } void AdvancedFm::switchToRemoteTab() { - TabWidget->setCurrentTab(1); + TabWidget->setCurrentWidget(1); Remote_View->setFocus(); } void AdvancedFm::readConfig() { Config cfg("AdvancedFm"); } void AdvancedFm::writeConfig() { Config cfg("AdvancedFm"); } void AdvancedFm::currentPathComboChanged() { if(QDir( currentPathCombo->lineEdit()->text()).exists()) @@ -849,35 +849,35 @@ QListView * AdvancedFm::CurrentView() return Local_View; else return Remote_View; } QListView * AdvancedFm::OtherView() { if ( whichTab == 1) return Remote_View; else return Local_View; } void AdvancedFm::setOtherTabCurrent() { if ( whichTab == 1) - TabWidget->setCurrentTab(1); + TabWidget->setCurrentWidget(1); else - TabWidget->setCurrentTab(0); + TabWidget->setCurrentWidget(0); } void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { qDebug("qcop message "+msg ); QDataStream stream ( data, IO_ReadOnly ); if ( msg == "openDirectory(QString)" ) { qDebug("received"); QString file; stream >> file; gotoDirectory( (const QString &) file); } } void AdvancedFm::setDocument(const QString &file) { gotoDirectory( file); diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 94d7bd7..5e2c769 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -17,33 +17,33 @@ //#include <opie/otabwidget.h> #include <opie/oprocess.h> #include <qpe/ir.h> #include <qpe/qcopenvelope_qws.h> #include <qvariant.h> #include <qdialog.h> #include <qmainwindow.h> #include <qstringlist.h> #include <qdir.h> #include <qstring.h> #include <qpoint.h> #include <qtimer.h> #include <qpixmap.h> -class OTabWidget; +class OSplitter; class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QComboBox; class QListView; class QListviewItem; class QLabel; class QProgressBar; class QSpinBox; class QTabWidget; class QWidget; class QPopupMenu; class QFile; class QListViewItem; class QLineEdit; class MenuButton; @@ -77,33 +77,33 @@ protected slots: void tabChanged(QWidget*); void cleanUp(); void renameIt(); void runThis(); void runText(); void filePerms(); void doProperties(); void runCommand(); void runCommandStd(); QStringList getPath(); void mkSym(); void switchToLocalTab(); void switchToRemoteTab(); protected: - OTabWidget *TabWidget; + OSplitter *TabWidget; QCopChannel * channel; QPixmap unknownXpm; int whichTab; // QTabWidget *TabWidget; QWidget *tab, *tab_2, *tab_3; QListView *Local_View, *Remote_View; QLineEdit *currentPathEdit; QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; QDir currentDir, currentRemoteDir; QComboBox *currentPathCombo; QString filterStr, s_addBookmark, s_removeBookmark; QListViewItem * item; bool b; diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 45dc0c4..463b202 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp @@ -1,30 +1,30 @@ /*************************************************************************** advancedfmData.cpp ------------------- ** Created: Mon 09-23-2002 13:24:11 copyright : (C) 2002 by ljp email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include "advancedfm.h" -#include <opie/otabwidget.h> +#include <opie/osplitter.h> #include <qpe/storage.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/menubutton.h> #include <qlayout.h> #include <qhbox.h> #include <qmenubar.h> #include <qcombobox.h> #include <qtoolbutton.h> #include <qlineedit.h> #include <qlistview.h> #include <sys/utsname.h> @@ -117,79 +117,80 @@ void AdvancedFm::init() { menuButton->setUseLabel(false); menuButton->setMaximumWidth( 20 ); menuButton->insertItem( s_addBookmark); menuButton->insertItem( s_removeBookmark); menuButton->insertSeparator(); customDirsToMenu(); currentPathCombo = new QComboBox( FALSE, lineBox, "currentPathCombo" ); currentPathCombo->setEditable(TRUE); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); layout->addWidget( lineBox ); - TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); + TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); // TabWidget = new QTabWidget( this, "TabWidget" ); layout->addWidget( TabWidget, 4 ); tab = new QWidget( TabWidget, "tab" ); tabLayout = new QGridLayout( tab ); tabLayout->setSpacing( 2); tabLayout->setMargin( 2); Local_View = new QListView( tab, "Local_View" ); Local_View->addColumn( tr("File"),130); Local_View->addColumn( tr("Size"),-1); Local_View->setColumnAlignment(1,QListView::AlignRight); Local_View->addColumn( tr("Date"),-1); Local_View->setColumnAlignment(2,QListView::AlignRight); Local_View->setAllColumnsShowFocus(TRUE); Local_View->setMultiSelection( TRUE ); Local_View->setSelectionMode(QListView::Extended); QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); tabLayout->addWidget( Local_View, 0, 0 ); - TabWidget->addTab( tab,"advancedfm/smFileBrowser.png", tr("1")); + TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); // TabWidget->insertTab( tab, tr("1")); tab_2 = new QWidget( TabWidget, "tab_2" ); tabLayout_2 = new QGridLayout( tab_2 ); tabLayout_2->setSpacing( 2); tabLayout_2->setMargin( 2); Remote_View = new QListView( tab_2, "Remote_View" ); Remote_View->addColumn( tr("File"),130); Remote_View->addColumn( tr("Size"),-1); Remote_View->setColumnAlignment(1,QListView::AlignRight); Remote_View->addColumn( tr("Date"),-1); Remote_View->setColumnAlignment(2,QListView::AlignRight); Remote_View->setAllColumnsShowFocus(TRUE); Remote_View->setMultiSelection( TRUE ); Remote_View->setSelectionMode(QListView::Extended); QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); tabLayout_2->addWidget( Remote_View, 0, 0 ); - TabWidget->addTab( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); + TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); + TabWidget->setSizeChange( 370 ); // TabWidget->insertTab( tab_2, tr( "2")); /* tab_3 = new QWidget( TabWidget, "tab_3" ); tabLayout_3 = new QGridLayout( tab_3 ); tabLayout_3->setSpacing( 2); tabLayout_3->setMargin( 2); // OFileDialog fileDialog; // fileDialog; // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); QListView *fileTree; fileTree = new QListView( tab_3, "tree" ); @@ -219,33 +220,33 @@ void AdvancedFm::init() { } if( !StorageInfo::hasCf() ) { qDebug("not have cf"); cfButton->hide(); } currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); currentDir.setPath( QDir::currentDirPath()); currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); currentRemoteDir.setPath( QDir::currentDirPath()); // b = TRUE; filterStr="*"; b=FALSE; showMenuHidden(); - TabWidget->setCurrentTab(0); + TabWidget->setCurrentWidget(0); } void AdvancedFm::initConnections() { connect( qApp,SIGNAL( aboutToQuit()), this, SLOT( cleanUp()) ); connect( qpeDirButton ,SIGNAL(released()), this,SLOT( QPEButtonPushed()) ); connect( cfButton ,SIGNAL(released()), this,SLOT( CFButtonPushed()) ); connect( sdButton ,SIGNAL(released()), this,SLOT( SDButtonPushed()) ); connect( cdUpButton ,SIGNAL(released()), this,SLOT( upDir()) ); |