* renamed tab "root" to "My computer"

* on win32 allow browsing drives in "My computer" tab
* improved icons for home and "My computer" browser



git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1767 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-10-18 11:54:53 +00:00
parent 58c2980507
commit f24995bef3
6 changed files with 42 additions and 9 deletions

View File

@@ -1,5 +1,14 @@
2008-10-18 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/file_browser.h:
* src/gui/main_window.cpp:
* src/gui/file_browser.cpp:
* data/themes/default/computer.png:
* data/themes/default/home.png:
- renamed tab "root" to "My computer"
- on win32 allow browsing drives in "My computer" tab
- improved icons for home and "My computer" browser
* include/embed.h:
* include/instrument_track.h:
* include/plugin.h:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -51,7 +51,7 @@ class fileBrowser : public sideBarWidget
public:
fileBrowser( const QString & _directories, const QString & _filter,
const QString & _title, const QPixmap & _pm,
QWidget * _parent );
QWidget * _parent, bool _dirs_as_items = false );
virtual ~fileBrowser();
@@ -69,6 +69,7 @@ private:
QString m_directories;
QString m_filter;
bool m_dirsAsItems;
} ;
@@ -130,8 +131,11 @@ public:
{
_path = m_directories[0];
}
return( QDir::cleanPath( _path + QDir::separator() +
text( 0 ) ) +
if( _path != QString::null )
{
_path += QDir::separator();
}
return( QDir::cleanPath( _path + text( 0 ) ) +
QDir::separator() );
}

View File

@@ -56,10 +56,11 @@ enum TreeWidgetItemTypes
fileBrowser::fileBrowser( const QString & _directories, const QString & _filter,
const QString & _title, const QPixmap & _pm,
QWidget * _parent ) :
QWidget * _parent, bool _dirs_as_items ) :
sideBarWidget( _title, _pm, _parent ),
m_directories( _directories ),
m_filter( _filter )
m_filter( _filter ),
m_dirsAsItems( _dirs_as_items )
{
setWindowTitle( tr( "Browser" ) );
m_l = new listView( contentParent() );
@@ -99,6 +100,13 @@ void fileBrowser::reloadTree( void )
void fileBrowser::addItems( const QString & _path )
{
if( m_dirsAsItems )
{
m_l->addTopLevelItem( new directory( _path,
QString::null, m_filter ) );
return;
}
QDir cdir( _path );
QStringList files = cdir.entryList( QDir::Dirs, QDir::Name );
for( QStringList::const_iterator it = files.constBegin();

View File

@@ -118,10 +118,22 @@ mainWindow::mainWindow( void ) :
tr( "My home" ),
embed::getIconPixmap( "home" ),
splitter ), ++id );
side_bar->appendTab( new fileBrowser( QDir::rootPath(), "*",
tr( "Root directory" ),
embed::getIconPixmap( "root" ),
splitter ), ++id );
QFileInfoList drives = QDir::drives();
QStringList root_paths;
foreach( const QFileInfo & drive, drives )
{
root_paths += drive.absolutePath();
}
side_bar->appendTab( new fileBrowser( root_paths.join( "*" ), "*",
tr( "My computer" ),
embed::getIconPixmap( "computer" ),
splitter,
#ifdef LMMS_BUILD_WIN32
true
#else
false
#endif
), ++id );
m_workspace = new QMdiArea( splitter );