diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2006-02-15 14:25:45 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2006-02-15 14:25:45 +0000 |
commit | c741a7980db9861d22ab4aa9dabbdcfc4a05fd56 (patch) | |
tree | 723a575ed9069a9ed78f844efbd5bc052a3623e7 | |
parent | c0826a497bab7e09424b1bd631184fab1349a697 (diff) | |
download | control-center-c741a7980db9861d22ab4aa9dabbdcfc4a05fd56.tar control-center-c741a7980db9861d22ab4aa9dabbdcfc4a05fd56.tar.gz control-center-c741a7980db9861d22ab4aa9dabbdcfc4a05fd56.tar.bz2 control-center-c741a7980db9861d22ab4aa9dabbdcfc4a05fd56.tar.xz control-center-c741a7980db9861d22ab4aa9dabbdcfc4a05fd56.zip |
- move hw upload from harddrake here
- add a wait message
- run a browser on hcl.mandriva.com
-rwxr-xr-x | control-center | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/control-center b/control-center index 271718ff..7276a7c6 100755 --- a/control-center +++ b/control-center @@ -1067,6 +1067,7 @@ my ($notebook_global, $saved_pos_while_in_menu); my @menu_items = ( [ N("/_File"), undef, undef, undef, '<Branch>' ], + [ N("/_File") . N("/_Upload the hardware list"), N("<control>U"), \&upload, undef, '<Item>' ], [ N("/_File") . N("/_Quit"), N("<control>Q"), \&quit_global, undef, '<Item>', N("Quit") ], [ N("/_Options"), undef, undef, undef, '<Branch>' ], [ join('', @{$options{show_log}}), undef, @@ -1592,6 +1593,50 @@ sub warn_on_startup { } } +sub upload() { + my $dialog = _create_dialog(N("Upload the hardware list"), + { transient => $window_global->{real_window} }); #, height => 400 + gtkpack($dialog->vbox, + gtkset_markup(Gtk2::Label->new, qq(<span weight="bold">) . N("Upload the hardware list") . "</span>\n"), + create_packtable({ col_spacings => 10, row_spacings => 5, mcc => 1 }, + [ N("Account:"), my $account_w = Gtk2::Entry->new ], + [ N("Password:"), my $password_w = Gtk2::Entry->new ], + [ N("Hostname:"), my $system_name_w = Gtk2::Entry->new ], + ), + ); +$password_w->set_visibility(0); #set_invisible_char('*'); + + my ($password, $account, $name); + gtkadd($dialog->action_area, + create_okcancel( + { + cancel_clicked => sub { $dialog->destroy; Gtk2->main_quit }, + ok_clicked => sub { + $name = $system_name_w->get_text; + $account = $account_w->get_text; + $password = $password_w->get_text; + $dialog->destroy; + Gtk2->main_quit; + }, + }, + undef, undef, '', + ), + ); + + $dialog->set_has_separator(0); + $dialog->show_all; + Gtk2->main; + if ($account) { + require interactive; + my $wait = 'interactive'->vnew->wait_message(N("Please wait"), N("Uploading in progress")); + #info_dialog(N("Please wait"), N("Uploading in progress")); + + local $ENV{HWDB_PASSWD} = $password; + require run_program; + run_program::run("/usr/sbin/hwdb_add_system", $account, $name); + run_program::raw({ detach => 1 }, "/usr/bin/www-browser", 'http://hcl.mandriva.com/'); + } +} #------------------------------------------------------------- |