summaryrefslogtreecommitdiff
authorzecke <zecke>2004-03-25 20:07:06 (UTC)
committer zecke <zecke>2004-03-25 20:07:06 (UTC)
commit875064bec847768670d33cddf8553ce89ef4a5d5 (patch) (unidiff)
tree5df41ec8e4f980e052db7785d219d1f97ab3fedc
parent97016caf3a660676a8a1ce300b7e4c7588262209 (diff)
downloadopie-875064bec847768670d33cddf8553ce89ef4a5d5.zip
opie-875064bec847768670d33cddf8553ce89ef4a5d5.tar.gz
opie-875064bec847768670d33cddf8553ce89ef4a5d5.tar.bz2
Wims patch for changing the margins to give more space
and to fix renaming
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp16
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp2
2 files changed, 12 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 73ef8f9..ce7da24 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -15,67 +15,67 @@
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/menubutton.h> 17#include <qpe/menubutton.h>
18 18
19#include <qlayout.h> 19#include <qlayout.h>
20#include <qhbox.h> 20#include <qhbox.h>
21#include <qmenubar.h> 21#include <qmenubar.h>
22#include <qcombobox.h> 22#include <qcombobox.h>
23#include <qtoolbutton.h> 23#include <qtoolbutton.h>
24#include <qlineedit.h> 24#include <qlineedit.h>
25#include <qlistview.h> 25#include <qlistview.h>
26 26
27#include <sys/utsname.h> 27#include <sys/utsname.h>
28 28
29 29
30using namespace Opie::Ui; 30using namespace Opie::Ui;
31void AdvancedFm::init() { 31void AdvancedFm::init() {
32#if defined(QT_QWS_OPIE) 32#if defined(QT_QWS_OPIE)
33 qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!"); 33 qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!");
34#endif 34#endif
35 setCaption( tr( "AdvancedFm" ) ); 35 setCaption( tr( "AdvancedFm" ) );
36 36
37 QVBoxLayout *layout = new QVBoxLayout( this ); 37 QVBoxLayout *layout = new QVBoxLayout( this );
38 layout->setSpacing( 2); 38 layout->setSpacing( 2);
39 layout->setMargin( 2); 39 layout->setMargin( 0); // squeeze
40 40
41 QMenuBar *menuBar = new QMenuBar(this); 41 QMenuBar *menuBar = new QMenuBar(this);
42 menuBar->setMargin( 0 ); // squeeze
42 fileMenu = new QPopupMenu( this ); 43 fileMenu = new QPopupMenu( this );
43 viewMenu = new QPopupMenu( this ); 44 viewMenu = new QPopupMenu( this );
44// customDirMenu = new QPopupMenu( this ); 45// customDirMenu = new QPopupMenu( this );
45 46
46 layout->addWidget( menuBar ); 47 layout->addWidget( menuBar );
47 48
48 menuBar->insertItem( tr( "File" ), fileMenu); 49 menuBar->insertItem( tr( "File" ), fileMenu);
49 menuBar->insertItem( tr( "View" ), viewMenu); 50 menuBar->insertItem( tr( "View" ), viewMenu);
50 51
51 cdUpButton = new QToolButton( 0,"cdUpButton"); 52 cdUpButton = new QToolButton( 0,"cdUpButton");
52 cdUpButton->setPixmap(Resource::loadPixmap("up")); 53 cdUpButton->setPixmap(Resource::loadPixmap("up"));
53 cdUpButton->setAutoRaise( true ); 54 cdUpButton->setAutoRaise( true );
54 menuBar->insertItem( cdUpButton ); 55 menuBar->insertItem( cdUpButton );
55 56
56 57
57 QHBox *lineBox = new QHBox( this );
58 58
59 qpeDirButton= new QToolButton( 0,"QPEButton"); 59 qpeDirButton= new QToolButton( 0,"QPEButton");
60 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); 60 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton");
61 qpeDirButton->setAutoRaise( true ); 61 qpeDirButton->setAutoRaise( true );
62 menuBar->insertItem( qpeDirButton ); 62 menuBar->insertItem( qpeDirButton );
63 63
64 cfButton = new QToolButton( 0, "CFButton"); 64 cfButton = new QToolButton( 0, "CFButton");
65 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); 65 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
66 cfButton->setAutoRaise( true ); 66 cfButton->setAutoRaise( true );
67 menuBar->insertItem( cfButton ); 67 menuBar->insertItem( cfButton );
68 68
69 sdButton = new QToolButton( 0, "SDButton"); 69 sdButton = new QToolButton( 0, "SDButton");
70 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); 70 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard"));
71 sdButton->setAutoRaise( true ); 71 sdButton->setAutoRaise( true );
72 menuBar->insertItem( sdButton ); 72 menuBar->insertItem( sdButton );
73 73
74 docButton = new QToolButton( 0,"docsButton"); 74 docButton = new QToolButton( 0,"docsButton");
75 docButton->setPixmap(Resource::loadPixmap("DocsIcon")); 75 docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
76 docButton->setAutoRaise( true ); 76 docButton->setAutoRaise( true );
77 menuBar->insertItem( docButton ); 77 menuBar->insertItem( docButton );
78 78
79 homeButton = new QToolButton( 0, "homeButton"); 79 homeButton = new QToolButton( 0, "homeButton");
80 homeButton->setPixmap(Resource::loadPixmap("home")); 80 homeButton->setPixmap(Resource::loadPixmap("home"));
81 homeButton->setAutoRaise( true ); 81 homeButton->setAutoRaise( true );
@@ -93,65 +93,71 @@ void AdvancedFm::init() {
93 fileMenu->insertSeparator(); 93 fileMenu->insertSeparator();
94 fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); 94 fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
95 fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); 95 fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() ));
96 fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); 96 fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() ));
97 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); 97 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() ));
98 fileMenu->setCheckable(TRUE); 98 fileMenu->setCheckable(TRUE);
99 99
100 viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); 100 viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab()));
101 viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); 101 viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab()));
102// viewMenu->insertSeparator(); 102// viewMenu->insertSeparator();
103// viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); 103// viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
104 viewMenu->setCheckable(true); 104 viewMenu->setCheckable(true);
105 viewMenu->setItemChecked( viewMenu->idAt(0), true); 105 viewMenu->setItemChecked( viewMenu->idAt(0), true);
106 viewMenu->setItemChecked( viewMenu->idAt(1), false); 106 viewMenu->setItemChecked( viewMenu->idAt(1), false);
107 107
108 s_addBookmark = tr("Bookmark Directory"); 108 s_addBookmark = tr("Bookmark Directory");
109 s_removeBookmark = tr("Remove Current Directory from Bookmarks"); 109 s_removeBookmark = tr("Remove Current Directory from Bookmarks");
110 110
111// menuButton->insertItem(""); 111// menuButton->insertItem("");
112 112
113// customDirMenu->insertItem(tr("Add This Directory")); 113// customDirMenu->insertItem(tr("Add This Directory"));
114// customDirMenu->insertItem(tr("Remove This Directory")); 114// customDirMenu->insertItem(tr("Remove This Directory"));
115// customDirMenu->insertSeparator(); 115// customDirMenu->insertSeparator();
116 116
117 menuButton = new MenuButton( lineBox ); 117 QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later
118 CBHB->setMargin( 0 );
119 CBHB->setSpacing( 1 );
120
121 menuButton = new MenuButton( this );
118 122
119 menuButton->setUseLabel(false); 123 menuButton->setUseLabel(false);
120 menuButton->setMaximumWidth( 20 ); 124 menuButton->setMaximumWidth( 20 );
121 menuButton->insertItem( s_addBookmark); 125 menuButton->insertItem( s_addBookmark);
122 menuButton->insertItem( s_removeBookmark); 126 menuButton->insertItem( s_removeBookmark);
123 menuButton->insertSeparator(); 127 menuButton->insertSeparator();
124 menuButton->setFocusPolicy(NoFocus); 128 menuButton->setFocusPolicy(NoFocus);
129 CBHB->addWidget( menuButton );
125 130
126 customDirsToMenu(); 131 customDirsToMenu();
127 132
128 currentPathCombo = new QComboBox( FALSE, lineBox, "currentPathCombo" ); 133 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" );
129 currentPathCombo->setEditable(TRUE); 134 currentPathCombo->setEditable(TRUE);
130 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 135 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
131 currentPathCombo->setFocusPolicy(NoFocus); 136 currentPathCombo->setFocusPolicy(NoFocus);
132 layout->addWidget( lineBox ); 137 CBHB->addWidget( currentPathCombo );
133 138
139 layout->addLayout( CBHB );
134 140
135 TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); 141 TabWidget = new OSplitter( Horizontal, this, "TabWidget" );
136// TabWidget = new QTabWidget( this, "TabWidget" ); 142// TabWidget = new QTabWidget( this, "TabWidget" );
137 layout->addWidget( TabWidget, 4 ); 143 layout->addWidget( TabWidget, 4 );
138 144
139 tab = new QWidget( TabWidget, "tab" ); 145 tab = new QWidget( TabWidget, "tab" );
140 tabLayout = new QGridLayout( tab ); 146 tabLayout = new QGridLayout( tab );
141 tabLayout->setSpacing( 2); 147 tabLayout->setSpacing( 2);
142 tabLayout->setMargin( 2); 148 tabLayout->setMargin( 2);
143 149
144 Local_View = new QListView( tab, "Local_View" ); 150 Local_View = new QListView( tab, "Local_View" );
145 Local_View->addColumn( tr("File"),130); 151 Local_View->addColumn( tr("File"),130);
146 Local_View->addColumn( tr("Size"),-1); 152 Local_View->addColumn( tr("Size"),-1);
147 Local_View->setColumnAlignment(1,QListView::AlignRight); 153 Local_View->setColumnAlignment(1,QListView::AlignRight);
148 Local_View->addColumn( tr("Date"),-1); 154 Local_View->addColumn( tr("Date"),-1);
149 Local_View->setColumnAlignment(2,QListView::AlignRight); 155 Local_View->setColumnAlignment(2,QListView::AlignRight);
150 Local_View->setAllColumnsShowFocus(TRUE); 156 Local_View->setAllColumnsShowFocus(TRUE);
151 Local_View->setMultiSelection( TRUE ); 157 Local_View->setMultiSelection( TRUE );
152 Local_View->setSelectionMode(QListView::Extended); 158 Local_View->setSelectionMode(QListView::Extended);
153 Local_View->setFocusPolicy(StrongFocus); 159 Local_View->setFocusPolicy(StrongFocus);
154 Local_View->installEventFilter( this ); 160 Local_View->installEventFilter( this );
155 161
156 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); 162 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
157 163
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 6d41ac3..2461e26 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -795,44 +795,44 @@ void AdvancedFm::doRename(QListView * view) {
795 795
796 renameBox->selectAll(); 796 renameBox->selectAll();
797 renameBox->installEventFilter( this ); 797 renameBox->installEventFilter( this );
798 798
799 view->addChild( renameBox, r.x(), r.y() ); 799 view->addChild( renameBox, r.x(), r.y() );
800 800
801 renameBox->resize( r.size() ); 801 renameBox->resize( r.size() );
802 802
803 view->viewport()->setFocusProxy( renameBox ); 803 view->viewport()->setFocusProxy( renameBox );
804 804
805 renameBox->setFocus(); 805 renameBox->setFocus();
806 renameBox->show(); 806 renameBox->show();
807} 807}
808 808
809 809
810void AdvancedFm::renameIt() { 810void AdvancedFm::renameIt() {
811 if( !CurrentView()->currentItem()) return; 811 if( !CurrentView()->currentItem()) return;
812 812
813 QListView *thisView = CurrentView(); 813 QListView *thisView = CurrentView();
814 oldName = thisView->currentItem()->text(0); 814 oldName = thisView->currentItem()->text(0);
815 doRename( thisView ); 815 doRename( thisView );
816} 816}
817 817
818void AdvancedFm::okRename() { 818void AdvancedFm::okRename() {
819 if( !CurrentView()->currentItem()) return; 819 if( !renameBox) return;
820 820
821 QString newName = renameBox->text(); 821 QString newName = renameBox->text();
822 cancelRename(); 822 cancelRename();
823 QListView * view = CurrentView(); 823 QListView * view = CurrentView();
824 QString path = CurrentDir()->canonicalPath() + "/"; 824 QString path = CurrentDir()->canonicalPath() + "/";
825 oldName = path + oldName; 825 oldName = path + oldName;
826 newName = path + newName; 826 newName = path + newName;
827 if( rename( oldName.latin1(), newName.latin1())== -1) 827 if( rename( oldName.latin1(), newName.latin1())== -1)
828 QMessageBox::message(tr("Note"),tr("Could not rename")); 828 QMessageBox::message(tr("Note"),tr("Could not rename"));
829 else 829 else
830 oldName = ""; 830 oldName = "";
831 view->takeItem( view->currentItem() ); 831 view->takeItem( view->currentItem() );
832 delete view->currentItem(); 832 delete view->currentItem();
833 rePopulate(); 833 rePopulate();
834} 834}
835 835
836void AdvancedFm::openSearch() { 836void AdvancedFm::openSearch() {
837 QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); 837 QMessageBox::message(tr("Note"),tr("Not Yet Implemented"));
838} 838}