aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--Rpmdrake/edit_urpm_sources.pm9
2 files changed, 9 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 45116f3d..e998920f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
- all
be able to handle --expert
+- edit-urpm-sources:
+ o by default do not enable to alter the 'update' flag (unless
+ --expert is given)
- gurpmi.addmedia
o instead of discarding --update when using --distrib, give it a meaning:
only add media flagged "update"
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index fc618907..c04eb2be 100644
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -51,6 +51,7 @@ my %col = (
is_update => 1,
type => 2,
name => 3,
+ activatable => 4
},
);
@@ -970,7 +971,7 @@ sub mainwindow() {
),
);
- my $list = Gtk2::ListStore->new("Glib::Boolean", "Glib::Boolean", "Glib::String", "Glib::String");
+ my $list = Gtk2::ListStore->new("Glib::Boolean", "Glib::Boolean", "Glib::String", "Glib::String", "Glib::Boolean");
$list_tv = Gtk2::TreeView->new_with_model($list);
$list_tv->get_selection->set_mode('multiple');
my ($dw_button, $edit_button, $remove_button, $up_button);
@@ -1016,7 +1017,7 @@ sub mainwindow() {
);
$list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Enabled"), my $tr = Gtk2::CellRendererToggle->new, 'active' => $col{mainw}{is_enabled}));
- $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Updates"), my $cu = Gtk2::CellRendererToggle->new, 'active' => $col{mainw}{is_update}));
+ $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Updates"), my $cu = Gtk2::CellRendererToggle->new, 'active' => $col{mainw}{is_update}, activatable => $col{mainw}{activatable}));
$list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Type"), Gtk2::CellRendererText->new, 'text' => $col{mainw}{type}));
$list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Medium"), Gtk2::CellRendererText->new, 'text' => $col{mainw}{name}));
@@ -1074,7 +1075,9 @@ sub mainwindow() {
$list->append_set($col{mainw}{is_enabled} => !$_->{ignore},
$col{mainw}{is_update} => ! !$_->{update},
$col{mainw}{type} => get_medium_type($_),
- $col{mainw}{name} => $name);
+ $col{mainw}{name} => $name,
+ $col{mainw}{activatable} => to_bool($::expert),
+ );
}
$reorder_ok = 1;
};
ss="hl kwa">array(); /** * Constructs a new instance of \phpbb\datetime, expanded to include an argument to inject * the user context and modify the timezone to the users selected timezone if one is not set. * * @param user $user object for context. * @param string $time String in a format accepted by strtotime(). * @param \DateTimeZone $timezone Time zone of the time. */ public function __construct($user, $time = 'now', \DateTimeZone $timezone = null) { $this->user = $user; $timezone = $timezone ?: $this->user->timezone; parent::__construct($time, $timezone); } /** * Formats the current date time into the specified format * * @param string $format Optional format to use for output, defaults to users chosen format * @param boolean $force_absolute Force output of a non relative date * @return string Formatted date time */ public function format($format = '', $force_absolute = false) { $format = $format ? $format : $this->user->date_format; $format = self::format_cache($format, $this->user); $relative = ($format['is_short'] && !$force_absolute); $now = new self($this->user, 'now', $this->user->timezone); $timestamp = $this->getTimestamp(); $now_ts = $now->getTimeStamp(); $delta = $now_ts - $timestamp; if ($relative) { /* * Check the delta is less than or equal to 1 hour * and the delta not more than a minute in the past * and the delta is either greater than -5 seconds or timestamp * and current time are of the same minute (they must be in the same hour already) * finally check that relative dates are supported by the language pack */ if ($delta <= 3600 && $delta > -60 && ($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60)) && isset($this->user->lang['datetime']['AGO'])) { return $this->user->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); } else { $midnight = clone $now; $midnight->setTime(0, 0, 0); $midnight = $midnight->getTimestamp(); if ($timestamp <= $midnight + 2 * 86400) { $day = false; if ($timestamp > $midnight + 86400) { $day = 'TOMORROW'; } else if ($timestamp > $midnight) { $day = 'TODAY'; } else if ($timestamp > $midnight - 86400) { $day = 'YESTERDAY'; } if ($day !== false) { // Format using the short formatting and finally swap out the relative token placeholder with the correct value return str_replace(self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER, $this->user->lang['datetime'][$day], strtr(parent::format($format['format_short']), $format['lang'])); } } } } return strtr(parent::format($format['format_long']), $format['lang']); } /** * Magic method to convert DateTime object to string * * @return string Formatted date time, according to the users default settings. */ public function __toString() { return $this->format(); } /** * Pre-processes the specified date format * * @param string $format Output format * @param user $user User object to use for localisation * @return array Processed date format */ static protected function format_cache($format, $user) { $lang = $user->lang_name; if (!isset(self::$format_cache[$lang])) { self::$format_cache[$lang] = array(); } if (!isset(self::$format_cache[$lang][$format])) { // Is the user requesting a friendly date format (i.e. 'Today 12:42')? self::$format_cache[$lang][$format] = array( 'is_short' => strpos($format, self::RELATIVE_WRAPPER) !== false, 'format_short' => substr($format, 0, strpos($format, self::RELATIVE_WRAPPER)) . self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER . substr(strrchr($format, self::RELATIVE_WRAPPER), 1), 'format_long' => str_replace(self::RELATIVE_WRAPPER, '', $format), 'lang' => array_filter($user->lang['datetime'], 'is_string'), ); // Short representation of month in format? Some languages use different terms for the long and short format of May if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) { self::$format_cache[$lang][$format]['lang']['May'] = $user->lang['datetime']['May_short']; } } return self::$format_cache[$lang][$format]; } }