forked from cromer/pamac-classic
add global menu
This commit is contained in:
@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac-classic")
|
||||
set (RELEASE_NAME "pamac-classic")
|
||||
set (CMAKE_C_FLAGS "")
|
||||
set (PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
set (VERSION "6.4.1")
|
||||
set (VERSION "6.5.0")
|
||||
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
|
||||
set (DOLLAR "$")
|
||||
|
||||
configure_file (${CMAKE_SOURCE_DIR}/src/pamac-manager/Config.vala.base ${CMAKE_BINARY_DIR}/src/pamac-manager/Config.vala)
|
||||
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
|
||||
set (VERSION "6.4.1")
|
||||
set (VERSION "6.5.0")
|
||||
add_definitions (${DEPS_CFLAGS})
|
||||
include_directories ( ${CMAKE_BINARY_DIR}/src )
|
||||
link_libraries ( ${DEPS_LIBRARIES} -lpamacclassic )
|
||||
@@ -46,6 +46,11 @@ if (ENABLE_UPDATE_ICON)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_UPDATE_ICON " )
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_UPDATE_ICON " )
|
||||
endif ()
|
||||
if (ENABLE_HAMBURGER)
|
||||
set (COMPILE_OPTIONS ${COMPILE_OPTIONS} -D ENABLE_HAMBURGER)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_HAMBURGER " )
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_HAMBURGER " )
|
||||
endif ()
|
||||
if (KDE_TRAY)
|
||||
set (COMPILE_OPTIONS ${COMPILE_OPTIONS} -D KDE_TRAY)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DKDE_TRAY " )
|
||||
|
@@ -20,6 +20,8 @@
|
||||
|
||||
//using GIO
|
||||
|
||||
extern void exit(int exit_code);
|
||||
|
||||
const string VERSION = Constants.VERSION;
|
||||
|
||||
namespace Pamac {
|
||||
@@ -39,7 +41,6 @@ namespace Pamac {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[GtkTemplate (ui = "/org/pamac/manager/interface/manager_window.ui")]
|
||||
class ManagerWindow : Gtk.ApplicationWindow {
|
||||
// icons
|
||||
@@ -57,8 +58,19 @@ namespace Pamac {
|
||||
public Gtk.Stack main_stack;
|
||||
[GtkChild]
|
||||
Gtk.Button button_back;
|
||||
[GtkChild]
|
||||
Gtk.HeaderBar headerbar;
|
||||
[GtkChild]
|
||||
Gtk.MenuButton button_menu_global;
|
||||
[GtkChild]
|
||||
Gtk.MenuButton button_menu;
|
||||
#if ENABLE_HAMBURGER
|
||||
[GtkChild]
|
||||
Gtk.ModelButton preferences_button;
|
||||
#else
|
||||
[GtkChild]
|
||||
Gtk.ModelButton preferences_button_global;
|
||||
#endif
|
||||
[GtkChild]
|
||||
Gtk.TreeView packages_treeview;
|
||||
[GtkChild]
|
||||
@@ -170,6 +182,14 @@ namespace Pamac {
|
||||
public ManagerWindow (Gtk.Application application) {
|
||||
Object (application: application);
|
||||
|
||||
#if ENABLE_HAMBURGER
|
||||
headerbar.remove(button_menu_global);
|
||||
button_menu.toggled.connect (on_menu_button_toggled);
|
||||
#else
|
||||
headerbar.remove(button_menu);
|
||||
button_menu_global.toggled.connect (on_menu_button_toggled);
|
||||
#endif
|
||||
|
||||
#if DISABLE_AUR
|
||||
packages_stack.remove (aur_scrolledwindow);
|
||||
packages_stackswitcher.visible = false;
|
||||
@@ -1844,9 +1864,13 @@ namespace Pamac {
|
||||
refresh_packages_list ();
|
||||
}
|
||||
|
||||
[GtkCallback]
|
||||
|
||||
void on_menu_button_toggled () {
|
||||
#if ENABLE_HAMBURGER
|
||||
preferences_button.sensitive = !(transaction_running || sysupgrade_running);
|
||||
#else
|
||||
preferences_button_global.sensitive = !(transaction_running || sysupgrade_running);
|
||||
#endif
|
||||
}
|
||||
|
||||
[GtkCallback]
|
||||
@@ -1951,6 +1975,16 @@ namespace Pamac {
|
||||
"website", "http://github.com/cromnix/pamac-classic");
|
||||
}
|
||||
|
||||
[GtkCallback]
|
||||
void on_quit_button_clicked () {
|
||||
//Gtk.main_quit ();
|
||||
this.quit();
|
||||
}
|
||||
|
||||
void quit() {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
[GtkCallback]
|
||||
void on_details_button_clicked () {
|
||||
important_details = false;
|
||||
|
@@ -4,7 +4,7 @@ cfg_pamac_manager.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('
|
||||
cfg_pamac_manager.set('GETTEXT_PACKAGE', 'pamac-classic')
|
||||
cfg_pamac_manager.set('RELEASE_NAME', 'pamac-classic')
|
||||
cfg_pamac_manager.set('PREFIX', get_option('prefix'))
|
||||
cfg_pamac_manager.set('VERSION', '6.4.1')
|
||||
cfg_pamac_manager.set('VERSION', '6.5.0')
|
||||
cfg_pamac_manager.set('TESTSRCDIR', meson.source_root())
|
||||
|
||||
cfgfile_6 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_manager)
|
||||
@@ -31,6 +31,10 @@ if ENABLE_UPDATE_ICON
|
||||
pamac_manager_vala_args += ['-D', 'ENABLE_UPDATE_ICON']
|
||||
pamac_manager_c_args += ['-DENABLE_UPDATE_ICON']
|
||||
endif
|
||||
if ENABLE_HAMBURGER
|
||||
pamac_manager_vala_args += ['-D', 'ENABLE_HAMBURGER']
|
||||
pamac_manager_c_args += ['-DENABLE_HAMBURGER']
|
||||
endif
|
||||
if KDE_TRAY
|
||||
pamac_manager_vala_args += ['-D', 'KDE_TRAY']
|
||||
pamac_manager_c_args += ['-DKDE_TRAY']
|
||||
|
Reference in New Issue
Block a user