Commit Graph

23 Commits

Author SHA1 Message Date
Luca Bacci 8902b0a260 Use Gtk::Grid for Dialog_Partition_Info (!25)
Gtk::Table was deprecated in Gtk 3.4.0.  Replace with Gtk::Grid.

This commit makes the change for Dialog_Partition_Info.

Closes !25 - Modern Gtk3 - part 1
2019-04-27 12:03:05 +01:00
Luca Bacci 363868bf5c Use Gtk::Box for Dialog_Partition_Info (!25)
Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2.  Replace with
plain Gtk::Box.

This commit makes the change for Dialog_Partition_Info.{h,cc}.

Closes !25 - Modern Gtk3 - part 1
2019-04-27 12:03:04 +01:00
Luca Bacci 74bb981ed2 Use Gdk::RGBA (!25)
The Gdk::RGBA data type was introduced to replace Gdk::Color in
Gtkmm 3.0 [1], with Gdk::Color being deprecated in Gtkmm 3.10 [2].

With this commit we make the change to Gdk::RGBA data type which is the
modern replacement to Gdk::Color.  Gdk::RGBA can be used almost as a
drop in replacement because it keeps most of the Gdk::Color interface.

Also, this commit removes the C Gtk call introduced during the
port-to-gtk3 patchset by commit:
    5379352766
    repare-for-gtk3: Prepare for removal of Gtk::Widget::modify_fg() (#7)

[1] Gtkmm 3.0.1 NEWS file
    https://gitlab.gnome.org/GNOME/gtkmm/blob/3.0.1/NEWS#L48
        * RGBA replaces Color, though Color still exists because it is
          used by TextView.  We hope to deprecated Color completely in
          gtkmm 3.2.

[2] Gtkmm 3.10.0 NEWS file
    https://gitlab.gnome.org/GNOME/gtkmm/blob/3.10.0/NEWS#L127
        Gdk:
        * Deprecate Color.

Closes !25 - Modern Gtk3 - part 1
2019-04-27 12:03:04 +01:00
Luca Bacci 4c1fe3bf7a port-to-gtk3: Use draw signal in the partition info dialog (#7)
In Gtk2 widgets draw themselves in response to the expose event signal.
In Gtk3 widgets draw themselves in response to the GtkWidget::draw
signal, and the signal handler gets a Cairo context as an argument.

Convert Gtk::DrawingArea rendering code to respond to the
GtkWidget::draw signal.

This commit is specific to the drawing area in the Partition Info
dialog.

Reference:

[1] Migrating from GTK+ 2.x to GTK+ 3 - "The GtkWidget::draw signal":
    https://developer.gnome.org/gtk3/stable/ch26s02.html#id-1.6.3.4.11

Closes #7 - Port to Gtk3
2019-02-11 08:57:18 +00:00
Luca Bacci 7fd39932a3 modern-gtk2: Use Cairo for drawing the partition info (!17)
Second commit in a series to convert Gdk::GC based drawing to Cairo
based drawing.  This specific commit makes the transition for the
graphical partition info widget that is used in the "Information about"
dialog.

Closes !17 - Gtk2 modernisation
2018-11-12 21:50:42 +00:00
Mike Fleetwood 53fd80e6ca Provide virtual Partition::get_filesystem_partition() method (#774818)
There are multiple cases of code wanting to work with the Partition
object directly containing the file system, regardless of whether it is
within a PartitionLUKS object or not.  The code had to do something
similar to this to access it:

    const Partition * filesystem_ptn = &partition;
    if ( partition.filesystem == FS_LUKS && partition.busy )
            filesystem_ptn = &dynamic_cast<const PartitionLUKS *>( &partition )->get_encrypted();
    ...
    // Access Partition object directly containing the file system
    filesystem_ptn-> ...

Implement and use virtual accessor get_filesystem_partition() which
allows the code to be simplified like this:

    const Partition & filesystem_ptn = partition.get_filesystem_partition();
    ...
    // Access Partition object directly containing the file system
    filesystem_ptn. ...

Bug 774818 - Implement LUKS read-write actions NOT requiring a
             passphrase
2017-01-14 08:49:58 -07:00
Mike Fleetwood 8979913a3f Remove "../include/" from GParted header #includes
It made the code look a little messy, is easily resolved in the build
system and made the dependencies more complicated than needed.  Each
GParted header was tracked via multiple different names (different
numbers of "../include/" prefixes).  For example just looking at how
DialogFeatures.o depends on Utils.h:

    $ cd src
    $ make DialogFeatures.o
    $ egrep ' [^ ]*Utils.h' .deps/DialogFeatures.Po
     ../include/DialogFeatures.h ../include/../include/Utils.h \
     ../include/../include/../include/../include/../include/../include/Utils.h \
     ../include/../include/../include/Utils.h \

After removing "../include/" from the GParted header #includes, just
need to add "-I../include" to the compile command via the AM_CPPFLAGS in
src/Makefile.am.  Now the dependencies on GParted header files are
tracked under a single name (with a single "../include/" prefix).  Now
DialogFeatures.o only depends on a single name to Utils.h:

    $ make DialogFeatures.o
    $ egrep ' [^ ]*Utils.h' .deps/DialogFeatures.Po
     ../include/DialogFeatures.h ../include/Utils.h ../include/i18n.h \
2016-12-12 13:15:34 -07:00
Mike Fleetwood f91d7e19dd Add encryption section into the Information dialog (#760080)
For LUKS formatted partitions add an encryption section into the
Information dialog and display the type of encryption, path, UUID and
status of the encryption.

The file system section continues to display appropriate file system
details, including the partition graphic with the file system specific
border colour and correct usage.  The details will either be of a plain
file system, an encrypted file system, or nothing when there is no open
dm-crypt mapping, leaving the encrypted file system inaccessible.
Should there be LUKS encryption directly within LUKS encryption then the
details of the inner encryption will be displayed in the file system
section.  However this configuration will not be further supported by
GParted.

Bug 760080 - Implement read-only LUKS support
2016-01-29 13:41:41 -07:00
Mike Fleetwood efaea94301 Stop copying selected partition object in Information dialog (#750168)
When opening the Partition Information dialog, creation of the dialog
object was creating a copy of the partition object to be displayed.  If
this was an extended partition it also included recursively constructing
the contained logical partitions too.

Instead, replace the partition object in the Dialog_Partition_Info class
with a reference to it.

NOTE:
In C++ a reference is really just a pointer under the hood.  As such,
dereferences of a pointer to an object in the context of needing a
reference to the object doesn't copy the object.  It merely initialises
the reference from the pointer.

Specifically, with this prototype:
    Dialog_Partition_Info( const Partition & partition );
and the dialog object being constructed in Win_GParted::activate_info():
    Dialog_Partition_Info dialog( *selected_partition_ptr );
the partition object is not copy constructed.  A reference (pointer) to
it is merely passed to the dialog constructor.

Bug 750168 - Reduce the amount of copying of partition objects
2015-06-10 10:43:43 -06:00
Curtis Gedak ccaeb8dc51 Make the partition information dialog resizable (#690542)
Make the dialog resizable, add a vertical scrollbar to the information
and messages section, and set the initial height to ensure the dialog
fits entirely on an 800x600 screen.

A default height is required because some window managers, such as
fluxbox used in GParted Live, only permit resizing the height by using
the bottom corners of the dialog.  If the dialog is too large for the
screen then the user would not be able to resize it.

Note that two default initial heights are used in an effort to minimize
the amount of extra whitespace.

Bug 690542 - Partition Information Dialog Warning not readable
2014-04-28 08:42:40 +01:00
Daniel Mustieles 3861b9257b Replace obsolete FSF postal address in copyright notices (#721565)
This is part of parent bug:
    Bug #721455 - Obsolete info in license text on multiple modules

and GNOME Goal:
    https://wiki.gnome.org/Initiatives/GnomeGoals/Proposals

    * verify all source files to make sure they have a license and a
      copyright, and that both are up-to-date

Bug #721565 -  License text contains obsolete FSF postal address
2014-01-26 10:53:23 +00:00
Mike Fleetwood 2b51d87147 Make include guards unique (#539297)
Include guards need to be unique within GParted code and all included
library header files.
    http://en.wikipedia.org/wiki/Include_guard#Difficulties

Use this model for all include guards:
    #ifndef GPARTED_FILE_NAME_H
    #define GPARTED_FILE_NAME_H
    ...
    #endif /* GPARTED_FILE_NAME_H */

Closes Bug #539297 - Make include guards unique
2013-06-05 10:57:39 -06:00
Mike Fleetwood 8ffd68b012 Display unallocated space in the information dialog (#499202)
Display the unallocated space in the graphical partition representation
and numeric figures in the Partition Information dialog.

Bug #499202 - gparted does not see the difference if partition size
              differs from filesystem size
2012-06-18 10:24:28 -06:00
Markus Elfring 91b971691d Bug #634090: Change some attributes to local variables
Some classes contained private attributes which were used only by a single
member function. Such items were moved to the corresponding function implementations
to stress their limited usage scope.

A few unused variables were also deleted.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2011-07-18 13:28:49 -06:00
Bart Hakvoort 677a21f50a improved errorhandling a bit. At the initialscan we store errors/warnings
* improved errorhandling a bit. At the initialscan we store
  errors/warnings now in a list per partition and show the in the
  partitioninfo dialog.
  While executing an operation we collect all libparted exceptions in
  a list and attach this list to the operationdetails when everything
  is done.
2006-07-30 15:13:41 +00:00
Bart Hakvoort 8a2624c3b8 cleanups
* include/Dialog_Partition_Info.h,
  include/Win_GParted.h,
  src/Win_GParted.cc: cleanups
2006-01-26 20:58:55 +00:00
Bart Hakvoort 7aee5aed95 added 'Glib::ustring mountpoint' implemented set_mountpoints() to set
* include/Partition.h,
  src/Partition.cc: added 'Glib::ustring mountpoint'
* include/GParted_Core.h,
  src/GParted_Core.cc: implemented set_mountpoints() to set mountpoint
  in partitions.
* include/Dialog_Partition_Info.h,
  src/Dialog_Partition_Info.cc: use Partition::mountpoint instead of
  finding it ourselves.
2005-12-08 17:03:29 +00:00
Bart Hakvoort bd3152788f implemented mk_label wherever possible 2004-10-06 19:06:43 +00:00
Bart Hakvoort 18b47725f8 enabled support for reiserfs 2004-10-06 15:32:40 +00:00
Bart Hakvoort 72f91cbc39 removed all stringstreams from the project (they were possibly responsible
* removed all stringstreams from the project (they were possibly responsible for rare chrashes in certain locales)
2004-10-02 09:39:16 +00:00
Bart Hakvoort 8ae5ebb2e6 several (mostly) i18n related fixes/cleanups 2004-09-29 12:33:40 +00:00
Bart Hakvoort 57e7ca3160 several small thingies, mostly i18n related 2004-09-28 21:12:20 +00:00
Bart Hakvoort 26d433260d Initial revision 2004-09-19 20:24:53 +00:00