Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Librem5
gnome-usage
Commits
ed1b97fd
Commit
ed1b97fd
authored
Sep 19, 2016
by
Petr Štětka
Browse files
Added tabs, and pained
parent
ed01f8c4
Changes
5
Hide whitespace changes
Inline
Side-by-side
data/org.gnome.Usage.desktop
0 → 100644
View file @
ed1b97fd
[Desktop Entry]
Name=GNOME Usage
Comment=View current processes and monitor system state
Categories=GNOME;GTK;System;Monitor;
Exec=hello-again
Icon=application-default-icon
Terminal=false
Type=Application
X-GNOME-Gettext-Domain=gnome-usage
Keywords=Monitor;System;Process;CPU;Memory;Network;History;Usage;Performance;Task;Manager;
gnome-usage.avprj
View file @
ed1b97fd
...
...
@@ -6,14 +6,29 @@ project_name: gnome-usage
*vala_binary: src/gnome-usage
*version: 0.0.1
*vala_check_package: atk
*vala_check_package: cairo
*vala_check_package: gdk-3.0
*vala_check_package: gdk-pixbuf-2.0
*vala_check_package: gio-2.0
*vala_check_package: glib-2.0
*vala_check_package: gobject-2.0
*vala_check_package: gtk+-3.0
*vala_check_package: pango
*vala_check_package: x11
*vala_source: application.vala
*vala_source: gnome-usage.vala
*vala_source: window.vala
*po: po
*translate: vala src/gnome-usage.vala
*translate: vala src/application.vala
*translate: vala src/window.vala
*data: data/local
*doc: doc
*desktop: data/org.gnome.Usage.desktop
src/application.vala
0 → 100644
View file @
ed1b97fd
using
Gtk
;
namespace
Usage
{
public
class
Application
:
Gtk
.
Application
{
private
Window
window
;
public
Application
()
{
application_id
=
"org.gnome.usage"
;
}
public
override
void
activate
()
{
window
=
new
Window
(
this
);
window
.
show_all
();
}
}
}
src/gnome-usage.vala
View file @
ed1b97fd
// project version=0.0.1
int
main
(
string
[]
args
)
{
print
(
"Hi, I will new GNOME Usage!\n"
);
return
0
;
public
static
int
main
(
string
[]
args
)
{
Intl
.
bindtextdomain
(
Constants
.
GETTEXT_PACKAGE
,
Path
.
build_filename
(
Constants
.
DATADIR
,
"locale"
));
Intl
.
setlocale
(
LocaleCategory
.
ALL
,
""
);
Intl
.
textdomain
(
Constants
.
GETTEXT_PACKAGE
);
Intl
.
bind_textdomain_codeset
(
Constants
.
GETTEXT_PACKAGE
,
"utf-8"
);
stdout
.
printf
(
"Not Translatable string"
);
stdout
.
printf
(
_
(
"Translatable string!"
));
var
application
=
new
Usage
.
Application
();
return
application
.
run
(
args
);
}
src/window.vala
0 → 100644
View file @
ed1b97fd
namespace
Usage
{
public
class
Window
:
Gtk
.
ApplicationWindow
{
public
Window
(
Gtk
.
Application
application
)
{
GLib
.
Object
(
application
:
application
);
this
.
destroy
.
connect
(
Gtk
.
main_quit
);
this
.
set_default_size
(
800
,
500
);
this
.
window_position
=
Gtk
.
WindowPosition
.
CENTER
;
var
stack
=
new
Gtk
.
Stack
();
stack
.
set_transition_type
(
Gtk
.
StackTransitionType
.
SLIDE_LEFT_RIGHT
);
stack
.
set_transition_duration
(
700
);
var
label1
=
new
Gtk
.
Label
(
"Page 1 Content."
);
var
label5
=
new
Gtk
.
Label
(
"Page 5 Content."
);
var
paned
=
new
Gtk
.
Paned
(
Gtk
.
Orientation
.
HORIZONTAL
);
paned
.
add1
(
label1
);
paned
.
add2
(
label5
);
stack
.
add_titled
(
paned
,
"page-1"
,
"Performance"
);
var
label2
=
new
Gtk
.
Label
(
"Page 2 Content."
);
stack
.
add_titled
(
label2
,
"page-2"
,
"Data"
);
var
label3
=
new
Gtk
.
Label
(
"Page 3 Content."
);
stack
.
add_titled
(
label3
,
"page-3"
,
"Storage"
);
var
label4
=
new
Gtk
.
Label
(
"Page 4 Content."
);
stack
.
add_titled
(
label4
,
"page-4"
,
"Power"
);
var
stack_switcher
=
new
Gtk
.
StackSwitcher
();
stack_switcher
.
halign
=
Gtk
.
Align
.
CENTER
;
stack_switcher
.
stack
=
stack
;
stack_switcher
.
set_stack
(
stack
);
var
headerbar
=
new
Gtk
.
HeaderBar
();
headerbar
.
show_close_button
=
true
;
headerbar
.
set_custom_title
(
stack_switcher
);
set_titlebar
(
headerbar
);
this
.
add
(
stack
);
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment