Ticket #647: padre.diff
| File padre.diff, 2.9 KB (added by agn, 4 years ago) |
|---|
-
trunk/Padre/lib/Padre/File/Local.pm
173 173 return File::Basename::dirname( $self->{filename} ); 174 174 } 175 175 176 sub readonly { 177 my $self = shift; 178 return 1 if (! -w $self->{filename}); 179 } 180 176 181 1; 177 182 178 183 # Copyright 2008-2009 The Padre development team as listed in Padre.pm. -
trunk/Padre/lib/Padre/Wx/StatusBar.pm
64 64 MIMETYPE => 3, 65 65 NEWLINE => 4, 66 66 POSTRING => 5, 67 RDONLY => 6, 67 68 }; 68 69 69 70 ##################################################################### … … 105 106 ); 106 107 107 108 # Set up the fields 108 $self->SetFieldsCount( 6);109 $self->SetFieldsCount(7); 109 110 110 111 #$self->SetStatusWidths( -1, 0, 100, 100, 50, 100 ); 111 112 … … 135 136 $self->SetStatusText( "", MIMETYPE ); 136 137 $self->SetStatusText( "", NEWLINE ); 137 138 $self->SetStatusText( "", POSTRING ); 139 $self->SetStatusText( "", RDONLY ); 138 140 return; 139 141 } 140 142 … … 187 189 my $format = '%' . length( $lines + 1 ) . 's,%-3s %3s%%'; 188 190 my $length = length( $lines + 1 ) + 8; 189 191 my $postring = sprintf( $format, ( $line + 1 ), $char, $percent ); 192 my $rdstatus = $self->is_read_only; 190 193 191 194 # update task load status 192 195 $self->update_task_status; … … 197 200 $self->SetStatusText( $mime_type_name, MIMETYPE ); 198 201 $self->SetStatusText( $newline, NEWLINE ); 199 202 $self->SetStatusText( $postring, POSTRING ); 203 $self->SetStatusText( $rdstatus, RDONLY ); 200 204 $self->SetStatusWidths( 201 205 -1, 202 206 $self->_task_width, … … 204 208 ( length($mime_type_name) + 2 ) * $width, 205 209 ( length($newline) + 2 ) * $width, 206 210 ( $length + 2 ) * $width, 211 length($rdstatus) * $width, 207 212 ); 208 213 209 214 # move the static bitmap holding the task load status … … 374 379 $sbmp->Refresh; 375 380 } 376 381 382 sub is_read_only { 383 my ($self) = @_; 384 my $file = $self->current->document->file || ''; 385 my $is_rdonly = $file->readonly if $file; 386 $is_rdonly ? return 'Read Only' : return ':)'; 387 } 388 389 377 390 1; 378 391 379 392 =pod -
trunk/Padre/lib/Padre/Wx/Main.pm
1022 1022 $self->GetStatusBar->update_pos( $_[0] or $self->current ); 1023 1023 } 1024 1024 1025 sub refresh_rdstatus { 1026 my $self = shift; 1027 return if $self->no_refresh; 1028 $self->GetStatusBar->is_read_only( $_[0] or $self->current ); 1029 } 1030 1025 1031 =pod 1026 1032 1027 1033 =head3 refresh_functions … … 4182 4188 # $self->refresh_status($current); 4183 4189 $self->refresh_cursorpos($current); 4184 4190 4191 $self->refresh_rdstatus($current); 4192 4185 4193 # $self->refresh_functions; 4186 4194 # $self->refresh_syntaxcheck; 4187 4195
