Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index b43d2ba..aa9db52 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -4,28 +4,28 @@ | |||
4 | ** Created: Mon 09-23-2002 13:24:11 | 4 | ** Created: Mon 09-23-2002 13:24:11 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | 13 | ||
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/oresource.h> | ||
16 | #include <qpe/applnk.h> | 17 | #include <qpe/applnk.h> |
17 | #include <qpe/storage.h> | 18 | #include <qpe/storage.h> |
18 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
19 | #include <qpe/resource.h> | ||
20 | #include <qpe/menubutton.h> | 20 | #include <qpe/menubutton.h> |
21 | using namespace Opie::Core; | 21 | using namespace Opie::Core; |
22 | using namespace Opie::Ui; | 22 | using namespace Opie::Ui; |
23 | 23 | ||
24 | /* QT */ | 24 | /* QT */ |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qhbox.h> | 26 | #include <qhbox.h> |
27 | #include <qmenubar.h> | 27 | #include <qmenubar.h> |
28 | #include <qcombobox.h> | 28 | #include <qcombobox.h> |
29 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qlistview.h> | 31 | #include <qlistview.h> |
@@ -43,58 +43,59 @@ void AdvancedFm::init() { | |||
43 | 43 | ||
44 | QMenuBar *menuBar = new QMenuBar(this); | 44 | QMenuBar *menuBar = new QMenuBar(this); |
45 | menuBar->setMargin( 0 ); // squeeze | 45 | menuBar->setMargin( 0 ); // squeeze |
46 | fileMenu = new QPopupMenu( this ); | 46 | fileMenu = new QPopupMenu( this ); |
47 | viewMenu = new QPopupMenu( this ); | 47 | viewMenu = new QPopupMenu( this ); |
48 | // customDirMenu = new QPopupMenu( this ); | 48 | // customDirMenu = new QPopupMenu( this ); |
49 | 49 | ||
50 | layout->addWidget( menuBar ); | 50 | layout->addWidget( menuBar ); |
51 | 51 | ||
52 | menuBar->insertItem( tr( "File" ), fileMenu); | 52 | menuBar->insertItem( tr( "File" ), fileMenu); |
53 | menuBar->insertItem( tr( "View" ), viewMenu); | 53 | menuBar->insertItem( tr( "View" ), viewMenu); |
54 | 54 | ||
55 | QPixmap pm; | 55 | bool useBigIcon = qApp->desktop()->size().width() > 330; |
56 | |||
56 | cdUpButton = new QToolButton( 0,"cdUpButton"); | 57 | cdUpButton = new QToolButton( 0,"cdUpButton"); |
57 | pm.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 58 | cdUpButton->setUsesBigPixmap( useBigIcon ); |
58 | cdUpButton->setPixmap( pm ); | 59 | cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); |
59 | cdUpButton->setAutoRaise( true ); | 60 | cdUpButton->setAutoRaise( true ); |
60 | menuBar->insertItem( cdUpButton ); | 61 | menuBar->insertItem( cdUpButton ); |
61 | 62 | ||
62 | qpeDirButton= new QToolButton( 0,"QPEButton"); | 63 | qpeDirButton= new QToolButton( 0,"QPEButton"); |
63 | pm.convertFromImage( Resource::loadImage( "logo/opielogo" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 64 | qpeDirButton->setUsesBigPixmap( useBigIcon ); |
64 | qpeDirButton->setPixmap( pm );//,"",this,"QPEButton"); | 65 | qpeDirButton->setPixmap( Opie::Core::OResource::loadPixmap( "logo/opielogo", Opie::Core::OResource::SmallIcon ) ); |
65 | qpeDirButton->setAutoRaise( true ); | 66 | qpeDirButton->setAutoRaise( true ); |
66 | menuBar->insertItem( qpeDirButton ); | 67 | menuBar->insertItem( qpeDirButton ); |
67 | 68 | ||
68 | cfButton = new QToolButton( 0, "CFButton"); | 69 | cfButton = new QToolButton( 0, "CFButton"); |
69 | pm.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 70 | cfButton->setUsesBigPixmap( useBigIcon ); |
70 | cfButton->setPixmap( pm ); | 71 | cfButton->setPixmap( Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ) ); |
71 | cfButton->setAutoRaise( true ); | 72 | cfButton->setAutoRaise( true ); |
72 | menuBar->insertItem( cfButton ); | 73 | menuBar->insertItem( cfButton ); |
73 | 74 | ||
74 | sdButton = new QToolButton( 0, "SDButton"); | 75 | sdButton = new QToolButton( 0, "SDButton"); |
75 | pm.convertFromImage( Resource::loadImage( "advancedfm/sdcard" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 76 | sdButton->setUsesBigPixmap( useBigIcon ); |
76 | sdButton->setPixmap( pm ); | 77 | sdButton->setPixmap( Opie::Core::OResource::loadPixmap( "advancedfm/sdcard", Opie::Core::OResource::SmallIcon ) ); |
77 | sdButton->setAutoRaise( true ); | 78 | sdButton->setAutoRaise( true ); |
78 | menuBar->insertItem( sdButton ); | 79 | menuBar->insertItem( sdButton ); |
79 | 80 | ||
80 | docButton = new QToolButton( 0,"docsButton"); | 81 | docButton = new QToolButton( 0,"docsButton"); |
81 | pm.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 82 | docButton->setUsesBigPixmap( useBigIcon ); |
82 | docButton->setPixmap( pm ); | 83 | docButton->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) ); |
83 | docButton->setAutoRaise( true ); | 84 | docButton->setAutoRaise( true ); |
84 | menuBar->insertItem( docButton ); | 85 | menuBar->insertItem( docButton ); |
85 | 86 | ||
86 | homeButton = new QToolButton( 0, "homeButton"); | 87 | homeButton = new QToolButton( 0, "homeButton"); |
87 | pm.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 88 | homeButton->setUsesBigPixmap( useBigIcon ); |
88 | homeButton->setPixmap( pm ); | 89 | homeButton->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) ); |
89 | homeButton->setAutoRaise( true ); | 90 | homeButton->setAutoRaise( true ); |
90 | menuBar->insertItem( homeButton ); | 91 | menuBar->insertItem( homeButton ); |
91 | 92 | ||
92 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 93 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
93 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 94 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
94 | fileMenu->insertSeparator(); | 95 | fileMenu->insertSeparator(); |
95 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | 96 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); |
96 | fileMenu->insertSeparator(); | 97 | fileMenu->insertSeparator(); |
97 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 98 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
98 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 99 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
99 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 100 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
100 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 101 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |