mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-13 00:24:29 +00:00
commit
7fc2be0e74
2 changed files with 45 additions and 40 deletions
|
@ -1812,15 +1812,15 @@ void MainFrame::create_main_toolbar( GtkWidget *window, GtkWidget *vbox ){
|
||||||
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SELECT_MOUSESCALE ) );
|
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SELECT_MOUSESCALE ) );
|
||||||
g_object_set_data( G_OBJECT( window ), "tb_select_mousescale", w );
|
g_object_set_data( G_OBJECT( window ), "tb_select_mousescale", w );
|
||||||
w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
|
w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
|
||||||
"", _( "Scale X" ), "", new_pixmap( window, "scalelockx.bmp" ),
|
"", _( "Disable Scaling Along X" ), "", new_pixmap( window, "scalelockx.bmp" ),
|
||||||
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SCALELOCKX ) );
|
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SCALELOCKX ) );
|
||||||
g_object_set_data( G_OBJECT( window ), "tb_scalelockx", w );
|
g_object_set_data( G_OBJECT( window ), "tb_scalelockx", w );
|
||||||
w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
|
w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
|
||||||
"", _( "Scale Y" ), "", new_pixmap( window, "scalelocky.bmp" ),
|
"", _( "Disable Scaling Along Y" ), "", new_pixmap( window, "scalelocky.bmp" ),
|
||||||
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SCALELOCKY ) );
|
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SCALELOCKY ) );
|
||||||
g_object_set_data( G_OBJECT( window ), "tb_scalelocky", w );
|
g_object_set_data( G_OBJECT( window ), "tb_scalelocky", w );
|
||||||
w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
|
w = gtk_toolbar_append_element( GTK_TOOLBAR( toolbar ), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
|
||||||
"", _( "Scale Z" ), "", new_pixmap( window, "scalelockz.bmp" ),
|
"", _( "Disable Scaling Along Z" ), "", new_pixmap( window, "scalelockz.bmp" ),
|
||||||
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SCALELOCKZ ) );
|
GTK_SIGNAL_FUNC( HandleCommand ), GINT_TO_POINTER( ID_SCALELOCKZ ) );
|
||||||
g_object_set_data( G_OBJECT( window ), "tb_scalelockz", w );
|
g_object_set_data( G_OBJECT( window ), "tb_scalelockz", w );
|
||||||
|
|
||||||
|
@ -4559,45 +4559,51 @@ void MainFrame::OnEditSaveprefab(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainFrame::OnPrefs(){
|
void MainFrame::OnPrefs() {
|
||||||
int nView = g_PrefsDlg.m_nView;
|
int nView = g_PrefsDlg.m_nView;
|
||||||
bool bToolbar = g_PrefsDlg.m_bWideToolbar;
|
int nShader = g_PrefsDlg.m_nShader;
|
||||||
bool bPluginToolbar = g_PrefsDlg.m_bPluginToolbar;
|
int nTextureQuality = g_PrefsDlg.m_nTextureQuality;
|
||||||
int nShader = g_PrefsDlg.m_nShader;
|
bool bToolbar = g_PrefsDlg.m_bWideToolbar;
|
||||||
int nTextureQuality = g_PrefsDlg.m_nTextureQuality;
|
bool bPluginToolbar = g_PrefsDlg.m_bPluginToolbar;
|
||||||
// int nLightRadiuses = g_PrefsDlg.m_nLightRadiuses;
|
bool bDetachableMenus = g_PrefsDlg.m_bDetachableMenus;
|
||||||
g_PrefsDlg.LoadPrefs();
|
bool bFloatingZ = g_PrefsDlg.m_bFloatingZ;
|
||||||
|
|
||||||
if ( g_PrefsDlg.DoModal() == IDOK ) {
|
g_PrefsDlg.LoadPrefs();
|
||||||
if ( ( g_PrefsDlg.m_nLatchedView != nView ) ||
|
|
||||||
( g_PrefsDlg.m_bLatchedDetachableMenus != g_PrefsDlg.m_bDetachableMenus ) ||
|
|
||||||
( g_PrefsDlg.m_bLatchedWideToolbar != bToolbar ) ||
|
|
||||||
( g_PrefsDlg.m_bLatchedPatchToolbar != bToolbar ) ||
|
|
||||||
( g_PrefsDlg.m_bLatchedPluginToolbar != bPluginToolbar ) ||
|
|
||||||
( g_PrefsDlg.m_nLatchedShader != nShader ) ||
|
|
||||||
( g_PrefsDlg.m_nLatchedTextureQuality != nTextureQuality )
|
|
||||||
|| ( g_PrefsDlg.m_bLatchedFloatingZ != g_PrefsDlg.m_bFloatingZ )
|
|
||||||
) {
|
|
||||||
gtk_MessageBox( m_pWidget, _( "You must restart Radiant for the changes to take effect." ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// if the view mode was switched to floating, set the Z window on by default
|
if(g_PrefsDlg.DoModal() == IDOK) {
|
||||||
// this was originally intended as a bug fix, but the fix is elsewhere .. anyway making sure we force Z on each time is good
|
if((g_PrefsDlg.m_nLatchedView != nView ) ||
|
||||||
// (and we simply hope there will be a SavePrefs before we die)
|
(g_PrefsDlg.m_bLatchedDetachableMenus != bDetachableMenus ) ||
|
||||||
if ( ( g_PrefsDlg.m_nView != nView ) && ( (EViewStyle)g_PrefsDlg.m_nView == (EViewStyle)eFloating ) ) {
|
(g_PrefsDlg.m_bLatchedWideToolbar != bToolbar ) ||
|
||||||
g_PrefsDlg.m_bZVis = true;
|
(g_PrefsDlg.m_bLatchedPatchToolbar != bToolbar ) ||
|
||||||
}
|
(g_PrefsDlg.m_bLatchedPluginToolbar != bPluginToolbar ) ||
|
||||||
|
(g_PrefsDlg.m_nLatchedShader != nShader ) ||
|
||||||
|
(g_PrefsDlg.m_nLatchedTextureQuality != nTextureQuality ) ||
|
||||||
|
(g_PrefsDlg.m_bLatchedFloatingZ != bFloatingZ)) {
|
||||||
|
gtk_MessageBoxNew(m_pWidget, "You must restart Radiant for the "
|
||||||
|
"changes to take effect.", "Restart Radiant",
|
||||||
|
MB_OK | MB_ICONINFORMATION);
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_pTexWnd ) {
|
// if the view mode was switched to floating, set the Z window on by
|
||||||
m_pTexWnd->UpdatePrefs();
|
// default. this was originally intended as a bug fix, but the fix is
|
||||||
}
|
// elsewhere .. anyway making sure we force Z on each time is good
|
||||||
|
// (and we simply hope there will be a SavePrefs before we die)
|
||||||
|
if((g_PrefsDlg.m_nView != nView) &&
|
||||||
|
((EViewStyle)g_PrefsDlg.m_nView == (EViewStyle)eFloating)) {
|
||||||
|
g_PrefsDlg.m_bZVis = true;
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget *item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_snaptogrid" ) );
|
if(m_pTexWnd) {
|
||||||
g_bIgnoreCommands++;
|
m_pTexWnd->UpdatePrefs();
|
||||||
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
|
}
|
||||||
( g_PrefsDlg.m_bSnap ) ? TRUE : FALSE );
|
|
||||||
g_bIgnoreCommands--;
|
GtkWidget *item = GTK_WIDGET(g_object_get_data(G_OBJECT(m_pWidget),
|
||||||
}
|
"menu_snaptogrid"));
|
||||||
|
g_bIgnoreCommands++;
|
||||||
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
|
||||||
|
(g_PrefsDlg.m_bSnap) ? TRUE : FALSE);
|
||||||
|
g_bIgnoreCommands--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainFrame::OnTogglecamera(){
|
void MainFrame::OnTogglecamera(){
|
||||||
|
|
|
@ -1453,8 +1453,7 @@ qboolean ConfirmModified() {
|
||||||
|
|
||||||
int saveChoice = gtk_MessageBoxNew( g_pParentWnd->m_pWidget,
|
int saveChoice = gtk_MessageBoxNew( g_pParentWnd->m_pWidget,
|
||||||
"The current map has changed since it was last saved.\n"
|
"The current map has changed since it was last saved.\n"
|
||||||
"Would you like to save before continuing?",
|
"Would you like to save before continuing?", "Radiant",
|
||||||
"Exit Radiant",
|
|
||||||
MB_YESNOCANCEL | MB_ICONQUESTION );
|
MB_YESNOCANCEL | MB_ICONQUESTION );
|
||||||
|
|
||||||
switch( saveChoice ) {
|
switch( saveChoice ) {
|
||||||
|
|
Loading…
Reference in a new issue