Skip to content
This repository has been archived by the owner on Feb 3, 2019. It is now read-only.

Commit

Permalink
v18.9
Browse files Browse the repository at this point in the history
  • Loading branch information
teejee2008 committed Sep 5, 2018
1 parent 057b93d commit 8ffa4ab
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 110 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
ukuu (18.9) xenial; urgency=medium

* Updated donation window

-- Tony George <[email protected]> Wed, 05 Sep 2018 10:00:00 +0530


ukuu (18.5.1) xenial; urgency=medium

* Fixed: Install linux-modules package if available
Expand Down
2 changes: 1 addition & 1 deletion src/Console/AppConsole.vala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using TeeJee.Misc;
public Main App;
public const string AppName = "Ubuntu Kernel Update Utility";
public const string AppShortName = "ukuu";
public const string AppVersion = "18.5.1";
public const string AppVersion = "18.9";
public const string AppAuthor = "Tony George";
public const string AppAuthorEmail = "[email protected]";

Expand Down
2 changes: 1 addition & 1 deletion src/Gtk/AppGtk.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using TeeJee.Misc;
public Main App;
public const string AppName = "Ubuntu Kernel Update Utility";
public const string AppShortName = "ukuu";
public const string AppVersion = "18.5.1";
public const string AppVersion = "18.9";
public const string AppAuthor = "Tony George";
public const string AppAuthorEmail = "[email protected]";

Expand Down
7 changes: 3 additions & 4 deletions src/Gtk/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,8 @@ public class MainWindow : Gtk.Window{
hbox.pack_start (button, true, true, 0);

button.clicked.connect(() => {
var dlg = new DonationWindow();
dlg.set_transient_for(this);
var dlg = new DonationWindow(this);
dlg.show_all();
dlg.run();
dlg.destroy();
});

// about
Expand Down Expand Up @@ -615,7 +612,9 @@ public class MainWindow : Gtk.Window{
}

dlg.update_status_line();

dlg.update_progressbar();

dlg.sleep(200);
gtk_do_events();

Expand Down
65 changes: 27 additions & 38 deletions src/Gtk/ProgressWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ using TeeJee.System;
using TeeJee.Misc;

public class ProgressWindow : Gtk.Window {

private Gtk.Box vbox_main;
private Gtk.Spinner spinner;
private Gtk.Label lbl_msg;
Expand All @@ -54,13 +55,16 @@ public class ProgressWindow : Gtk.Window {
// init

public ProgressWindow.with_parent(Window parent, string message, bool allow_cancel = false) {

set_transient_for(parent);
set_modal(true);
set_skip_taskbar_hint(true);
set_skip_pager_hint(true);
//set_type_hint(Gdk.WindowTypeHint.DIALOG);
window_position = WindowPosition.CENTER;

set_default_size(def_width, def_height);

icon = get_app_icon(16,".svg");

App.status_line = "";
Expand Down Expand Up @@ -89,6 +93,7 @@ public class ProgressWindow : Gtk.Window {
}

public void init_window () {

title = "";
icon = get_app_icon(16);
resizable = false;
Expand All @@ -97,7 +102,6 @@ public class ProgressWindow : Gtk.Window {
//vbox_main
vbox_main = new Gtk.Box(Orientation.VERTICAL, 6);
vbox_main.margin = 12;
vbox_main.set_size_request (def_width, def_height);
add (vbox_main);

var hbox_status = new Gtk.Box(Orientation.HORIZONTAL, 6);
Expand All @@ -108,39 +112,40 @@ public class ProgressWindow : Gtk.Window {
hbox_status.add(spinner);

//lbl_msg
lbl_msg = new Label (status_message);
lbl_msg = new Gtk.Label (status_message);
lbl_msg.halign = Align.START;
lbl_msg.ellipsize = Pango.EllipsizeMode.END;
lbl_msg.max_width_chars = 40;
hbox_status.add (lbl_msg);

var hbox = new Gtk.Box(Orientation.HORIZONTAL, 6);
vbox_main.add(hbox);

//progressbar
progressbar = new ProgressBar();
//progressbar.set_size_request(-1, 25);
progressbar.pulse_step = 0.1;
vbox_main.pack_start (progressbar, false, true, 0);
progressbar = new Gtk.ProgressBar();
progressbar.set_size_request(300, -1);
progressbar.hexpand = true;
//progressbar.pulse_step = 0.1;
hbox.add(progressbar);

//lbl_status
lbl_status = new Label ("");
lbl_status = new Gtk.Label ("");
lbl_status.halign = Align.START;
lbl_status.ellipsize = Pango.EllipsizeMode.END;
lbl_status.max_width_chars = 40;
vbox_main.pack_start (lbl_status, false, true, 0);
vbox_main.add (lbl_status);

//box
var box = new Gtk.Box(Orientation.HORIZONTAL, 6);
box.set_homogeneous(true);
vbox_main.add (box);

var sizegroup = new SizeGroup(SizeGroupMode.HORIZONTAL);

//btn
var button = new Gtk.Button.with_label (_("Cancel"));
button.margin_top = 6;
box.pack_start (button, false, false, 0);
btn_cancel = button;
sizegroup.add_widget(button);


button.clicked.connect(()=>{
App.cancelled = true;
btn_cancel.sensitive = false;
Expand All @@ -154,37 +159,15 @@ public class ProgressWindow : Gtk.Window {

// common

public void pulse_start(){
tmr_pulse = Timeout.add(100, pulse_timeout);
}

private bool pulse_timeout(){
if (tmr_pulse > 0) {
Source.remove(tmr_pulse);
tmr_pulse = 0;
}

progressbar.pulse();
gtk_do_events();

tmr_pulse = Timeout.add(100, pulse_timeout);
return true;
}

public void pulse_stop(){
if (tmr_pulse > 0) {
Source.remove(tmr_pulse);
tmr_pulse = 0;
}
}

public void update_message(string msg){

if (msg.length > 0){
lbl_msg.label = msg;
}
}

public void update_status_line(bool clear = false){

if (clear){
lbl_status.label = "";
}
Expand All @@ -197,18 +180,22 @@ public class ProgressWindow : Gtk.Window {
}

public void update_progressbar(){

double fraction = App.progress_count / (App.progress_total * 1.0);

if (fraction > 1.0){
fraction = 1.0;
}

progressbar.fraction = fraction;
gtk_do_events();
//gtk_do_events();
}

public void finish(string message = "") {

btn_cancel.sensitive = false;

pulse_stop();
//pulse_stop();
progressbar.fraction = 1.0;

lbl_msg.label = message;
Expand All @@ -221,6 +208,7 @@ public class ProgressWindow : Gtk.Window {
}

private void auto_close_window() {

tmr_close = Timeout.add(2000, ()=>{
if (tmr_init > 0) {
Source.remove(tmr_init);
Expand All @@ -234,6 +222,7 @@ public class ProgressWindow : Gtk.Window {
}

public void sleep(int ms){

Thread.usleep ((ulong) ms * 1000);
gtk_do_events();
}
Expand Down
Loading

0 comments on commit 8ffa4ab

Please sign in to comment.